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

markdown url tag fails when line is indented #835

Open
falkben opened this issue Sep 14, 2018 · 7 comments
Open

markdown url tag fails when line is indented #835

falkben opened this issue Sep 14, 2018 · 7 comments

Comments

@falkben
Copy link

falkben commented Sep 14, 2018

Attempting to use a url tag in markdown doesn't actually render the URL or static file into HTML, it just displays whatever was entered, including the url tag. Am I missing something?

[url('/content/pages/archive.md') ]

https://github.com/grow/grow.io/blob/master/content/docs/markdown-extensions.md#url

@Zoramite
Copy link
Member

You need to take out the extra space at the end: [url('/content/pages/archive.md')]

The docs mention this: # Remove the extra space after ).

Sorry for the trouble, but it parses it if the space isn't there, then it can't show the example in the docs.

@falkben
Copy link
Author

falkben commented Sep 18, 2018

Sorry, I copied directly from that help file, but in my code, I actually did take out the space. You can confirm it's working (without the space)?

@Zoramite
Copy link
Member

Here is an example:

On the docs page for templates, the docs are using the url tag.

See the [full documentation for the document API]([url('/content/docs/documents.md')]).

@falkben
Copy link
Author

falkben commented Sep 18, 2018

It seems as though I just had my parenthesis and square brackets wrong. Thanks for the help!

@falkben
Copy link
Author

falkben commented Sep 18, 2018

ah, I see the issue why it wasn't working -- indenting within the markdown file breaks the url tag from being processed

@Zoramite Zoramite reopened this Sep 18, 2018
@Zoramite Zoramite changed the title markdown url tag doesn't seem to be working markdown url tag fails when line is indented Sep 18, 2018
@Zoramite
Copy link
Member

Currently we don't do it when the line is indented because we can't easily tell if the line is in a code block or not (since code blocks in markdown are indented lines.

I'm not sure if we will be able to really fix it and allow it to be ignored in code blocks... but maybe that doesn't really matter if it parsed in code blocks.

@falkben
Copy link
Author

falkben commented Sep 19, 2018

Yea, I'm not sure how to disambiguate a code block versus indent. The python markdown library supposedly implements it as indents though, which is why I was confused it wasn't working as expected:

The syntax rules clearly state that when a list item consists of multiple paragraphs, “each subsequent paragraph in a list item must be indented by either 4 spaces or one tab” (emphasis added). However, many implementations do not enforce this rule and allow less than 4 spaces of indentation. The implementers of Python-Markdown consider it a bug to not enforce this rule.

This applies to any block level elements nested in a list, including paragraphs, sub-lists, blockquotes, code blocks, etc. They must always be indented by at least four spaces (or one tab) for each level of nesting.

In the event that one would prefer different behavior, tab_length can be set to whatever length is desired. Be warned however, as this will affect indentation for all aspects of the syntax (including root level code blocks).

-- https://python-markdown.github.io/#differences

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

No branches or pull requests

2 participants