Closed ldez closed 8 years ago
This is a great example of where the grammar sees something that the parser never does. By the time the parser sees the link, the attribute has been resolved. But to the writer, the attribute is part of the URL.
I'd like to propose a slight modification. I'd like to see the uri-
prefix required in order to make this match (e.g., {uri-google}[Google]
). That does two things. First, it promotes the best practice of adding the uri-
prefix to the name of a URI attribute. Second, it cuts out the ambiguity of matching the pattern {foo}[Bar]
when it is not a link.
When the explicit link:
prefix is specified, then we can assume it is always a link (e.g., link:{foo}[Bar]
).
Done!
I love it!
small bonus: attribute multi-lines who respect the line-break :wink:
Sweet like :candy: !
small bonus: attribute multi-lines who respect the line-break
...actually, I almost missed it. In Asciidoctor, we now prefer a backslash (\
) instead of a plus (+
) at the end of the line (like Bash). Could you switch it?
Asciidoctor also supports a hardbreak by using + \
at the end of the line. Example:
:address: Street + \
City, State ZIP
{address}
Supports backslash line-break and backslash hard-break.
:+1:
So @ldez if I understand it correctly, your wizardry fix is to have a very generic begin-end match, and only include line breaks with continuation characters, next to the inline styles? Very clever. This will be something to watch out for when we work on multi-line inlines like bold and italics ⚠️ because in paragraphs line-continuation will be handled differently:
:description: test *failing
multi-line*
:description: test *succeeding \
multi-line*
I guess we're going to need a separate library (include) for multi-line inline styles, to enable this type of line continuation in other parts.
Oh and by the way 😉 nice work on the URL matching. I assume you are going to pick up on the uri-
suggestion?
The uri-
suggestion is already done :wink:
My bad, I assumed it was emphasised in highlighting. Reading back I now see it was about restricting the regex. Alright then. LGTM
Description
Use attributes references with url
Syntax example
Screenshots