Comments (5)
In web/src/components/MemoEditor.tsx:handleSaveBtnClick
, Memos Web getMatchedNodes
from content.
// Upsert tag with the content.
const matchedNodes = getMatchedNodes(content);
const tagNameList = uniq(matchedNodes.filter((node) => node.parserName === "tag").map((node) => node.matchedContent.slice(1)));
for (const tagName of tagNameList) {
await tagStore.upsertTag(tagName);
}
getMatchedNodes
match nodes by some rules defined in web/src/labs/marked/parser/
, and what we interested in is web/src/labs/marked/parser/Tag.tsx
. It extracts tags by regular expression /#([^\s#]+)/
.
I have added some code to update tags, but I don't find a good expression which can find all tags. Thanks if somebody could help me!
from moememosandroid.
When I test a case like this:
#111 #222 #测试 #cs 测试
It can not identify chinese tags and English tags.
But if I do not match digits, it will work as expected:
from moememosandroid.
Thanks for the discussion!
One thing we need to take into account is #
mark in certain Markdown elements (code block, links, images, etc) should be avoided. I guess it could be done with intellij-markdown.
Or I wonder whether it's possible extend intellij-markdown
to support tags in a native way. (That will let memo card render tags too)
from moememosandroid.
Thanks for the discussion!
One thing we need to take into account is
#
mark in certain Markdown elements (code block, links, images, etc) should be avoided. I guess it could be done with intellij-markdown.Or I wonder whether it's possible extend
intellij-markdown
to support tags in a native way. (That will let memo card render tags too)
Yes, you are right, I forget #
is widely used in different elements. I have some questions about where to parse markdown elements in MemoInputPage.kt:submit
. I find Markdown
is used in Memocard.kt
, but we may analyze markdown elements in submit method?
For I have accomplish updateTag API (it is easy) and not sure how to accomplish parser, can I take a pr for only updateTag API or accomplish all features? I'm not a Android developer, and I'm a new hand in open source contribution. Thank you!
from moememosandroid.
Thanks for the discussion!
One thing we need to take into account is#
mark in certain Markdown elements (code block, links, images, etc) should be avoided. I guess it could be done with intellij-markdown.
Or I wonder whether it's possible extendintellij-markdown
to support tags in a native way. (That will let memo card render tags too)Yes, you are right, I forget
#
is widely used in different elements. I have some questions about where to parse markdown elements inMemoInputPage.kt:submit
. I findMarkdown
is used inMemocard.kt
, but we may analyze markdown elements in submit method?For I have accomplish updateTag API (it is easy) and not sure how to accomplish parser, can I take a pr for only updateTag API or accomplish all features? I'm not a Android developer, and I'm a new hand in open source contribution. Thank you!
Thanks! It's super welcome for any contribution and it's not required to be feature completed 😆
For reference, the parser used by MemosCard
is https://github.com/mudkipme/MoeMemosAndroid/blob/main/app/src/main/java/me/mudkip/moememos/ui/component/Markdown.kt#L41
from moememosandroid.
Related Issues (20)
- 手机端越权删除任意用户标签 HOT 3
- 安卓端同步Web端默认备忘录可见性
- 探索页面他人动态强制置顶 HOT 5
- MoeMemosAndroid评论功能 HOT 1
- Can this app support voice input HOT 3
- Function Request
- feature request: mTLS client certificates
- Cannot delete or mark memos public in the app
- Feature request: Enable search on the Explore section
- Cannot sign in with OpenID HOT 2
- Permissions are changed to private when you click to complete the task list
- French translation HOT 1
- Turkish Translation HOT 1
- Share buttons to memos
- 请问Play商店版是停更了吗? HOT 2
- 希望界面支持更多主题颜色 HOT 5
- network HOT 1
- Bottom bar takes up too much space in landscape mode
- 建议:关于新memo输入框 HOT 1
- Can't input '》' and '>'
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from moememosandroid.