Skip to content
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

Tabs in code blocks should not be replaced with spaces #14

Open
Soreine opened this issue Jun 15, 2016 · 2 comments
Open

Tabs in code blocks should not be replaced with spaces #14

Soreine opened this issue Jun 15, 2016 · 2 comments
Labels

Comments

@Soreine
Copy link
Contributor

Soreine commented Jun 15, 2016

Concerns the Markdown to HTML test for fixture markdown_documentation_syntax.md

Source:

Markdown provides backslash escapes for the following characters:

    \   backslash
    `   backtick
    *   asterisk
    _   underscore
    {}  curly braces
    []  square brackets
    ()  parentheses
    #   hash mark
    +   plus sign
    -   minus sign (hyphen)
    .   dot
    !   exclamation mark

Corresponding HTML file:

<pre><code>\   backslash
`   backtick
*   asterisk
_   underscore
{}  curly braces
[]  square brackets
()  parentheses
#   hash mark
+   plus sign
-   minus sign (hyphen)
.   dot
!   exclamation mark
</code></pre>

The tab \t between + and plus are expected to be replaced with spaces. We should look at other parsers' behaviors, and probably modifiy the test to expect the tabs to be left untouched.

@q0rban
Copy link

q0rban commented Mar 27, 2018

👍

A use case for this is when documenting Makefiles, since the difference between a tab and a space means the difference between a working and non-working Makefile.

Ironically, it seems that GitHub's parser is replacing your tabs with spaces in the above example, so I was having a hard time following the description at first. 😆

@q0rban
Copy link

q0rban commented Mar 27, 2018

For anyone else trying to find a workaround for this in GitBooks, this works:

<pre><code class="lang-sh">
foo:
&Tab;echo "bar"
</code></pre>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants