From 1bb492bd997cffb7a2cba91e175c78499b7ad3d7 Mon Sep 17 00:00:00 2001
From: fzk <458813868@qq.com>
Date: Thu, 10 Oct 2024 11:40:34 +0800
Subject: [PATCH] =?UTF-8?q?=E7=BC=96=E8=BE=91markdown?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
component/options/custom.tsx | 15 ++++++++++++++-
component/options/juejin.tsx | 15 ++++++++++++++-
contents/custom.tsx | 30 ++++++++++++++++++++++++++----
contents/juejin.tsx | 21 ++++++++++++++++++++-
contents/md.tsx | 29 +++++++++++++++++++++++++++++
locales/en/messages.json | 3 +++
locales/zh_CN/messages.json | 3 +++
package.json | 2 +-
8 files changed, 110 insertions(+), 8 deletions(-)
create mode 100644 contents/md.tsx
diff --git a/component/options/custom.tsx b/component/options/custom.tsx
index 055738d..fdc7abf 100644
--- a/component/options/custom.tsx
+++ b/component/options/custom.tsx
@@ -1,4 +1,4 @@
-import { DownloadOutlined, StarTwoTone } from "@ant-design/icons"
+import { DownloadOutlined, EditOutlined, StarTwoTone } from "@ant-design/icons"
import { Input } from "antd"
import { useEffect, useState } from "react"
@@ -25,6 +25,12 @@ export default function Custom() {
sendToContentScript({ name: `custom-scrollIntoViewCode`, body: { index } })
}
+ function editMarkdown() {
+ sendToContentScript({
+ name: "custom-editMarkdown"
+ })
+ }
+
function downloadMarkdown() {
sendToContentScript({
name: "custom-downloadMarkdown"
@@ -86,6 +92,13 @@ export default function Custom() {
onChange={(e) => setRenderValue(e.target.value)}
onBlur={(e) => setStoreValue()}>
+
+
+
+ {i18n("editMarkdown")}
+
+
+
diff --git a/component/options/juejin.tsx b/component/options/juejin.tsx
index 35a4399..831d611 100644
--- a/component/options/juejin.tsx
+++ b/component/options/juejin.tsx
@@ -1,10 +1,16 @@
-import { DownloadOutlined, StarTwoTone } from "@ant-design/icons"
+import { DownloadOutlined, EditOutlined, StarTwoTone } from "@ant-design/icons"
import { sendToContentScript } from "@plasmohq/messaging"
import { i18n } from "~tools"
export default function Juejin() {
+ function editMarkdown() {
+ sendToContentScript({
+ name: "juejin-editMarkdown"
+ })
+ }
+
function downloadMarkdown() {
sendToContentScript({
name: "juejin-downloadMarkdown"
@@ -20,6 +26,13 @@ export default function Juejin() {
return (