Comments (2)
This is awkward, yeah :( I'm a bit of a fan of the autolinker as it stands since its implementation is so straightforward, being separated out entirely from the reasonably ugly inline parser. (of course, this also makes it easiest to conform with the GFM autolinking examples, since it works the same way there. Trying to reproduce the same results via an algorithm that was integrated with the inline parser might be difficult.)
I don't think it's the worst to ask users to e.g. use <https://www.wolframalpha.com/input/?i=x^2+(y-(x^2)^(1/3))^2=1>
in this case, though the result it does give as-is is quite ugly.
from comrak.
It's a bit hard to recall exactly what I was thinking here, but I suspect the wording of the GFM spec suggests the OP's example should parse as a link (and old-Reddit of course does).
I agree that architecturally having the autolinker separate from parsing is much desirable to intertwining the logic with parsing, changing both comrak and upstream cmark to handle these cases would be quite hard, that it's probably best to just leave as-is, maybe word the spec more precisely and add more test cases like in the OP if it even comes down to it.
Edit: oh, GFM spec doesn't even define superscript, so it's hard to say anything about the spec, though it's reasonable to assume that extensions are additive and don't break other features. I'm not sure offhand if any other characters break URLs like ^
.
from comrak.
Related Issues (20)
- Should parsing a markdown file and rendering it back to markdown preserve the state? HOT 1
- Benchmark PR job failing due to permissions HOT 2
- About shortcodes, maybe a bug? HOT 1
- kivikakk/cmark-gfm doesn't exist HOT 1
- Construct an AST programmatically in 0.20 HOT 5
- [GFM] Alerts HOT 1
- How is the fuzzing run / fuzz testing as part of CI HOT 3
- Lists not exitable HOT 3
- Width options usage ? HOT 2
- nested lists not rendering properly HOT 1
- Adding Node.traverse() examples and/or documentation. HOT 9
- Invalid rendering of a list followed by another block HOT 9
- Rendering of hard line breaks HOT 2
- Can `comrak` format directories recursively? HOT 4
- Incorrect sourcepos for Setext headings HOT 1
- Change autolink to allow more protocols, same as normal markdown links HOT 5
- Autolink edge cases HOT 7
- Autolink edge case: underscores in url
- [feature request] Make copy-paste preserve markdown on generated HTML HOT 7
- Proposal: Discord-flavored Markdown HOT 2
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 comrak.