Giter Club home page Giter Club logo

Comments (2)

kivikakk avatar kivikakk commented on August 25, 2024

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.

brson avatar brson commented on August 25, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.