Comments (2)
To unstyle invalid bare links, the doc must be thoroughly parsed. However in CodeMirror, styling is an one-pass ( to keep the editor effective ). When a possible bare link appears , HyperMD assumes it's valid because it can't look ahead for the link definition footnotes.
However, this feature is still implementable by creating an add-on . The add-on shall check every visible bare links and unstyle the invalid ones via "markText" API . But this could be very slow, if the document is big.
Currently there's no plan to implement this.
from hypermd.
I was thinking that another strategy for this could be that we maintain a map of registered links where keys are the text within [...] and the link is specified.
Also maintain an index of all [.*] elements (let's call them tags, HyperMD must already do this since it styles them)
Now by default, assume that [...] doesn't refer to a link (because it's often used as a bracket in text).
On every text change, scan just the changed parts and update the map. Map updates wouldn't happen during regular text editing, this would only happen when you specifically write or edit a line which looks like the following
[tag]: some link
And if the map was updated, just go through the index in the background and update the required links (HyperMD must be already doing this too, since it provides a tooltip on hovering over the link)
However, I'm not actually familiar with structure of either CodeMirror or HyperMD so I don't know if this strategy is actually implementable. But if it's possible to just process the changed content instead of whole doc then it won't be necessary to scan the whole document every time
from hypermd.
Related Issues (20)
- Non-techie mode? HOT 1
- 关于主题和代码高亮
- 请问如何编译 import 的其他包的内容 HOT 2
- flow 左右分屏容易改造吗?
- Supporting syntax highlight for code block HOT 4
- :::info:::,
- Repo Active
- Cannot convert from `GLib.List<Gtk.Window>' to `GLib.List<weak Gtk.Window> HOT 1
- 官方能出VScode或者Nextcloud这种私有云的插件吗?
- How to import this as ES Module? HOT 2
- Not Highlighting code blocks in vue HOT 1
- Cant seem to get it working, always producing error
- The text box is wobbling badly
- The demo address cannot be opened HOT 1
- Hypermd syntax highlighter stops working inside a code block (Obsidian's Admonition-plugin, CodeMirror) HOT 1
- How to disable folding
- Demo site is down
- 文档和测试站点宕机了
- CodeMirror 6
- Working on a fork supporting CodeMirror 6
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 hypermd.