-
-
Notifications
You must be signed in to change notification settings - Fork 790
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Two hypens are rendered as dash in inline content #1717
Comments
According to http://asciidoctor.org/docs/user-manual/#replacements
or
This for inline content; if you wanted the command on a line by itself (ie a block) start the line with a space - then you don't need the pass macro or the backticks. git checkout -- . |
@rockyallen wrote:
In certain cases. It depends on the neighboring characters. @obfischer wrote:
It's important to remember that, as of Asciidoctor 1.5, backticks are for producing normal text in a monospace font. Normal substitution rules apply (just like if you made the text bold). In other words, the content is not treated literally. To prevent the substitutions from occurring, you need to use one of the following:
The most common approach is the See http://asciidoctor.org/docs/migration/#migration-cheatsheet for details. The reason we made this change in Asciidoctor is two-fold:
In the future, we may be able to limit the substitutions that occur within monospace text more intelligently, since hyphens are rarely desired there. However, we can't do it with the current inline parsing technique we're using. The annoying part is that you have to pay attention to when substitutions are being applied if you want to use |
@rockyallen do you think a clarification to the user manual is warranted given what I wrote in my response? |
Definitely. Particularly the rules about how the surrounding characters affect the replacement. Are the rules the same for all the replacements? Also you didn't repeat the +++ form of the pass: macro. Was that deliberate? |
The rules seem to be:
|
Yes. That's because +++ means to skip substitutions both for the input and the output. In other words, copy the content directly to the output stream. While it doesn't matter in this example, if the command contained a By default, the inline pass macro and +++ do the same thing, but the inline pass macro supports a custom substitution list. I updated the example above so that it encodes special characters ( |
It's not a perfect solution, so let's soften this to say "in most cases". "In most cases, replacements (table, section 40.4) can be escaped by adding a leading \ character (e.g.,
Let's drop this one. It's too vague.
Yes! Very good. |
Let's open an issue in the asciidoctor.org repository to track these changes. We can name the issue "Clarify when replacements are used and how to escape them". We'll sort out which section it belongs. @rockyallen would you like to file the issue. |
I ran into this issue when trying to add a link with two hyphens. The link in question is
When converted to HTML by
This ends up breaking the links in the generated HTML. When I click the link in Firefox, it navigates to:
|
That's a duplicate of #625, which has been explained. |
Escaping replacements is now covered in the docs. See:
In the AsciiDoc Language, we do plan to define the target of link and xref macros in such a way that only attribute references are substituted. That work is still ongoing. |
In shell commands "--" is often used to separate parameters and arguments. Unfortunately two hyphens are not always correctly rendered in inline content.
Given an input file with the following threee line
With Asciidoctor 1.5.1 the two hyphens in the first example are rendered as dash. In all other examples the two hyphens are rendered correctly.
The text was updated successfully, but these errors were encountered: