Grav: classes on markdown links

Created on 21 Feb 2017  路  3Comments  路  Source: getgrav/grav

Markdown

[link](#about?classes=btn,btn-primary)
[link](http://google.com?classes=btn,btn-primary) 

Rendered HTML

<a href="#about?classes=btn,btn-primary">link</a>
<a href="http://google.com" class="btn btn-primary">link</a>

Links created on pages work if the anchor is going to another url, but if going to an id on the page they do not render.

Is there a setting I missed somewhere or do I need to escape the '#' somehow?

Thanks

bug

Most helpful comment

Ok, I know what it is.. URL should look like this:

[link](?classes=btn,btn-primary#about)
[link](http://google.com?classes=btn,btn-primary)

Anchor fragment should come after the query. https://en.wikipedia.org/wiki/Fragment_identifier

Works with this syntx.

All 3 comments

Actually it's a known issue that the # target links are not working with classes. Glad you ticketed it as I had forgotten about it. I'll look at this soon.

Thanks @rhukster

Ok, I know what it is.. URL should look like this:

[link](?classes=btn,btn-primary#about)
[link](http://google.com?classes=btn,btn-primary)

Anchor fragment should come after the query. https://en.wikipedia.org/wiki/Fragment_identifier

Works with this syntx.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gizmecano picture gizmecano  路  17Comments

fabrizioT picture fabrizioT  路  26Comments

jens-t picture jens-t  路  18Comments

mlueck88 picture mlueck88  路  18Comments

Sogl picture Sogl  路  24Comments