Comments (9)
We use CodeMirror for most MD editors, so if they allow this, we can add it. Haven't seen it done before though.
from minimal-markdown-editor.
Seems like switching CM's mode to Github-flavored will do that out of the box https://codemirror.net/mode/gfm/index.html .
from minimal-markdown-editor.
Came here to post this exact same request! After signing up for an extended account I spent a few hours playing around with all the editors, and the biggest thing I immediately found missing vs. Simplenote was the lack of clickable hyperlinks, something I use probably dozens of times per day, in all sorts of notes.
@mobitar if as the above comment suggests this could be supported with 'GFM Mode' in CodeMirror, hopefully this would be doable, and an enormously helpful enhancement. Ideally could be enabled for all the different Markdown editor options…must admit I'm not totally sure all the differences between 'em but if they're all based on CodeMirror, may as well :)
from minimal-markdown-editor.
Links don't appear to be clickable in the GFM mode demo above.
from minimal-markdown-editor.
Ah darn, yeah I see that now. It does seem to be properly parsing the links though and adding markup to show them blue highlighted/underlined…just not making them clickable!
When I inspect the example there, looks like link are getting wrapped in a special class, e.g.:
<span class="cm-link">http://github.github.com/github-flavored-markdown/</span>
So it seems all it would take to make them clickable would be to wrap any such elements in an a
tag e.g.:
<a href="http://github.github.com/github-flavored-markdown/"><span class="cm-link">http://github.github.com/github-flavored-markdown/</span></a>
(Where the href value = identical to the text within the span.cm-link)
Does that seem like something that would be possible to add?
from minimal-markdown-editor.
I'm not sure, but even if it were, overriding CodeMirror behavior is outside the scope of my experience. Would happily welcome a PR though if it were possible.
from minimal-markdown-editor.
Gotcha. I also have no experience mucking around with overriding CodeMirror and not sure how feasible that would be. May be a little above my pay grade but does seem worth exploring :)
Any downside to enabling "GFM mode" in CodeMirror anyway so it at least highlights the links? Might make it easier to then add an extension to make them clickable, since the parsing would already be done at least?
I'd also be happy for this functionality (clickable hyperlinks) to work with the basic default editor, if that seems like a possibility. Not sure if that might be simpler than extending the CodeMirror functionality, guessing probably not…
I'm happy to look into this more at some point, just want to make sure I start in the right direction. Thanks!
from minimal-markdown-editor.
Update: found this reference which seems to address basically how this could be done—
https://stackoverflow.com/questions/26933344/codemirror-detect-and-create-links-inside-editor
Sounds like the first step, an "overlay mode" recognizing links, might already be taken care of by the GFM mode, which adds the cm-link
class.
So then would basically need to:
- Add a click listener, detect if target has
cm-link
class - Use
coordsChar
to get clicked position in the doc + extract the link
Idk if that's the best solution but sounds like one approach at least.
from minimal-markdown-editor.
Hmm interesting. Yeah a little too custom for my liking. But we can leave this open to see if anyone would be interested in working on it.
from minimal-markdown-editor.
Related Issues (20)
- Add to README.md which markdown features are available
- Add strikethrough to the set of markdown features HOT 2
- Highlighting unavailable on mobile HOT 2
- Markdown list: Sub items are not styled using StyleKit variables
- Is there a particular reason lists have a special highlight color? HOT 8
- No scroll bar on mobile
- Emojis in markdown view HOT 3
- Position in note on platform A is reset when note is edited on platform B
- "Select all" selects only a limited amount of text on mobile HOT 1
- Doesn't render note when its empty. HOT 6
- Sublists still render green HOT 5
- Tab Stops uneven HOT 1
- markdown problem HOT 3
- scroll bar irregularly loses theming HOT 2
- Support navigating between search items
- Android: Unable to type newlines after certain markdown elements
- Item list have wrong font with "dark" themes HOT 1
- Add README.md
- Enable Syntax Highlighting HOT 5
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 minimal-markdown-editor.