Follow

I can't decide if this is a great idea, or a terrible one…

Here's the problem it solves:

Markdown is supposed to look good both as plain text and when parsed to HTML. This *mostly* works for things like emphasis, but it doesn't work well for links.

So, here's the idea: a markup language that defines link text as anything between a zero width space and a `(` and the URL as everything before the `)`

So I could write:

> I wrote a blog post (codesections.com/blog/) about gtypist

Thoughts?

(You can't see it, but I promise that there *really is* a zero width space before "blog post" in ^^^^)

Show thread

@codesections At that point we may as well define new Unicode characters for markup. Or redefine HTML in terms of invisible characters. :blobcatmlem:

@ayo

> At that point we may as well define new Unicode characters for markup. Or redefine HTML in terms of invisible characters.

Fair enough. On the other hand, the "we" involved is pretty different. I don't know about you, but *I* can't get a whole range of new Unicode characters accepted.

On the other hand, I *could* write something that preprocesses my Markdown to let me use zero width spaces, so ¯\_(ツ)_/¯

@codesections @ayo *or* just use different emojis to denote different parts of text! :P

@codesections the main issue afaict is that it's hard to type a zero-width space. That's the great thing about the brackets -- they're easy to type, plus a reader of the markdown source immediately knows the "button" of the link, or what text will be part of the link. I can't tell where your link starts in your example -- it could be between literally any two characters before the parenthese.

@acdw

Yep, those are the reasons it might be a horrible idea :D

On the other hand

> reader of the markdown source immediately knows the "button" of the link

If you're a reader of it as plain text, it doesn't help you to know where the button is. If you're an *editor*, you need to know, but then you're probably using a text editor that displays zero width spaces (mine shows it as kind of a long, thin underscore)

@codesections fair enough, but since markdown is an authoring format a reader is probably also a writer or editor. So they'd still need to see the button.

And Im gonna be honest I have no idea how to see the zero width space. I think Vim only allows nbsp in :set list.

@codesections I would never want invisible control codes in my markup files. The typical way of
[title](url)

is pretty readable, but the footnote version
[title] [id]

[id]: URL

is nicer for print.

@mdhughes

> I would never want invisible control codes in my markup files.

Yeah, that's what I'm torn on. If I'm writing/editing the document in an environment that displays the invisible characters, then I might not mind.

But maybe that's a slippery slope towards rich text, I don't know…

@codesections Sure, why not just insert printer control codes in your text, like we did back in the '70s? ;-)

@mdhughes @codesections

And there is also

watchout for my [project]

[project]: https://project.example

@codesections I like it, looks good and "makes sense" without having to understand too much of the tech behind it.
But @acdw has a point, how hard would it be to type? I don't think "ctrl+shift+u200A" is a good solution.

@eldaking @acdw

> But @acdw has a point, how hard would it be to type? I don't think "ctrl+shift+u200A" is a good solution.

Yeah, that would depend heavily on authoring environment. Personally, it wouldn't be a problem – I could add it to the characters I can type using X11's `compose` key (which I'm already used to using for …, —, and similar). Or I could create a key combination in Emacs.

But I used a lot of different editors/computers, it'd be much harder

@codesections @eldaking @acdw
I don't agree that it "makes sense", it's much more comlicated to explain a zero width space than to just say "(link text)[example.com], now go make some links".

editors can help with that too. BBcode editors have existed for a while and Tumblr for example lets you switch between HTML, Markdown, and WYSIWYG modes.

@grainloom @codesections @eldaking 💯, in fact the only issue really with Markdown links is what you've demonstrated here: it's easy to get the different brackets mixed up.

@acdw @codesections @eldaking Oopsies.
Well, that could be easily added to parsers and used to send a warning.

@grainloom @codesections The advantage here would be that it looks nicer to read, not that markdown is too hard.
And I find the concept of the zero width space particularly intuitive for this use. It's an invisible separator, put it where in your text you want to separate the link from the text. What is confusing is most of all that it isn't on the keyboard.

@eldaking @codesections Why not just use a WYSIWYG editor then. Or pull up a live preview.
The marginal improvement in readability is not worth adding untypable magic syntax that doesn't even show up everywhere.

@codesections here's my thought : Markdown looking good as plain text is a joke and 100% of Markdown is consumed as HTML produced by one of the billion tools meant for that purpose.

@steko @codesections

While headed for html, my Markdown is convenient for me. I enjoy jotting down notes...mostly without thinking about the format...a double tap of the enter key for most between- note situations.

Then I "consume" my notes through the browser from local files compiled into a journal.

I don't expect links to be usable from the text of Markdown.

@steko @codesections I regularly consume my Markdown in plaintext form, either for notetaking or documentation.

It is more common for me to use plaintext Markdown than HTML-processed markdown.

@codesections no no no, the whole point of source code is for it to be readable and editable by humans, and the whole point of zero-width spaces is to *not* be visible to humans

@bugaevc @codesections Markdown already uses trailing space as syntax, so no difference there. ;)

@bugaevc @codesections “When you do want to insert a <br /> break tag using Markdown, you end a line with two or more spaces, then type return.” – daringfireball.net/projects/ma

@codesections sounds bad. Hard to type and prone to cause bugs/errors and will be hard to figure out why.

You could automatically format URIs as formatted links. Just add ftp:// or https:// or whatever.

@codesections Pandoc treats `<...>` as a link. Maybe that could be used elsewhere? The problem is that you have to write the full url including `https://` or whatever. But your proposal would require assuming something about that.

@codesections urls can contain parentheses (and they don't have to be balanced)

But balanced examples include links to wiki articles

Sign in to participate in the conversation
Fosstodon

Fosstodon is an English speaking Mastodon instance that is open to anyone who is interested in technology; particularly free & open source software.