Closed behrangsa closed 5 years ago
Yes. In this case you can strengthen the macro by adding the link: prefix.
== ASN.1link:https://en.wikipedia.org/wiki/Abstract_Syntax_Notation_One[^↝^]
The link: prefix makes the macro "unconstrained" (which means it can be used anywhere).
Thanks. That worked. But the syntax is a bit weird/not nice. 🤔
I think Markdown’s syntax is better and makes more sense - it shows the boundary of tokens much better.
How do you expect it to look? Like this?
== ASN.1https://en.wikipedia.org/wiki/Abstract_Syntax_Notation_One[^↝^]
(And is that really much of an improvement?)
Hi @mojavelinux,
Like this:
== ASN.1[↝](https://en.wikipedia.org/wiki/Abstract_Syntax_Notation_One)
which is rendered into:
Markdown does not supprt ^...^
for superscripts.
We'll, that's Markdown not AsciiDoc. I'm asking you how you would make the AsciiDoc simpler.
Yes, I was saying the AsciiDoc syntax for links in general, IMHO, is not as elegant as Markdown.
I had a quick look at AsciiDoc.org and didn't find a simpler alternative.
One option is to define the link as an attribute and use it later. That way the delimiters and token boundaries become clearer:
:link-asn1: https://en.wikipedia.org/wiki/Abstract_Syntax_Notation_One[^↝^]
== ASN.1{link-asn1}
Yes, I was saying the AsciiDoc syntax for links in general, IMHO, is not as elegant as Markdown.
Beauty is in the eye of the beholder, IMHO being able to simply show the URL with no markup and get a link is more elegant.
A terse inline separator is whats needed instead of link:
, not changing Asciidoc into markdown. @mojavelinux maybe backslash space?
I've argued before why I think the syntax for links is simpler in AsciiDoc than Markdown. I'm not going to rehash it here. But we're sticking with the syntax we have.
If you want to add support for the Markdown link syntax, you can write an inline macro with a custom match. See https://github.com/asciidoctor/asciidoctor-extensions-lab/blob/master/lib/mentions-inline-macro.rb for an example. If you'd like to contribute such an extension to the lab, I'd gladly merge it.
A terse inline separator is whats needed instead of link:, not changing Asciidoc into markdown. @mojavelinux maybe backslash space?
I think it's fine the way it is.
AsciiDoctor renders this:
As
ASN.1 ↝
with a whitespace between "ASN.1" and the link.
Is there a syntax that allows no whitespace in situations like this?