Code Monkey home page Code Monkey logo

Comments (4)

davidtheclark avatar davidtheclark commented on May 30, 2024 1

I've had only happy times with shortcut links, despite their theoretical flaws — I guess I've been lucky 😄

Say a link label was 999 characters long, would you still want a definition label with the same length?

Personally, I wouldn't want a link label that long any more than I'd want a definition label that long.

Sounds like I'm right that the static phrasing content throws a real wrench in the possibility ...

The only thing I really don't like about numbered references & definitions is that — when systematically applied, always counting from the document's top to its bottom — this means the addition or removal of a link in the middle of the document will result in changes to links & definitions all over the document, making a nasty diff. I can live with that, though.

from remark-reference-links.

davidtheclark avatar davidtheclark commented on May 30, 2024 1

Yeah, I did think about that, too. Considering the tradeoff of markdown legibility vs diff cleanliness, I might choose the legibility of the markdown, and so favor the bare numbers instead of potentially confusing-looking text 😬

from remark-reference-links.

wooorm avatar wooorm commented on May 30, 2024

Indeed, there are three types of reference links. Shortcuts ([asd]), collapsed ([asd][]), and full ([asd][fgh]). It’s unfortunate that shortcuts exist, they are extremely unclear. For example, adding [x]: example.com to a GFM document disables task lists 🤯. I strongly recommend against using shortcuts, and remark-lint warns about them I believe? To either escape one of the brackets, or add [].

Reference links are also fragile in CommonMark: [[asd]](https://link.com?) turns into a link for [asd] when it is defined. When it isn’t, it turns into a link to link.com. As definitions can be defined anywhere in a document, it makes it impossible to parse Markdown in a nice stream.

I personally do enjoy using collapsed and full reference links, so I see some use in your request. But indeed, the [your **favorite** dog] example is annoying. As link labels can be super long, and indeed contain static phrasing content... Say a link label was 999 characters long, would you still want a definition label with the same length? Wouldn’t a short label be better?

from remark-reference-links.

wooorm avatar wooorm commented on May 30, 2024

A different idea for numbers/letters/other orders: what if we “hash” the paragraph? E.g., first letter of first three and last three words:

Lorem ipsum dolor sit amet[1], consectetur adipisicing elit[2].

Yields:

Lorem ipsum dolor sit amet[lidcae-1], consectetur adipisicing elit[lidcae-2].

That should result in cleaner diffs

from remark-reference-links.

Related Issues (4)

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.