getgrav / grav

Modern, Crazy Fast, Ridiculously Easy and Amazingly Powerful Flat-File CMS powered by PHP, Markdown, Twig, and Symfony
https://getgrav.org
MIT License
14.46k stars 1.4k forks source link

problem with class on an a tag if a question mark is in the link #2786

Open meaz opened 4 years ago

meaz commented 4 years ago

I have a link like this: [text](xmpp:room@server.org?join)

I wanted to add a class to this link so: [text](xmpp:room@server.org?join?classes=button)

But it doesn't work. If I remove the "?join" part it works.

rhukster commented 4 years ago

Your description doesn't have any code, I guess it got lost?

in markdown just do:

[text](http://mylink.com?classes=foo)
meaz commented 4 years ago

Thanks @rhukster I just edited my post to correct the links. As you can see the problem is when there is two question marks.

mahagr commented 4 years ago

You cannot have two question marks in a URL. Use [text](xmpp:room@server.org?join&classes=button) instead.

meaz commented 4 years ago

thanks!

meaz commented 4 years ago

I'm actually reopening the issue because I still have an issue. Here is the link I have a problem with: https://webchat.server.org/#converse/room?jid=room@chat.server.org&classes=lighter But that is displayed like this: <a href="https://webchat.server.org/#converse/room?jid=room@chat.server.org&classes=lighter">

mahagr commented 4 years ago

The link looks identical and correct. Looks like the link is for JS as servers will not see anything after #.

meaz commented 4 years ago

so I can't do anything about it, right @mahagr ? I mean, can't add any class to this markdown link...

mahagr commented 4 years ago

Do you mean that instead of getting a hyperlink you get HTML source code?

meaz commented 4 years ago

No, no. I do have a hyperlink. But what I meant is that as I have to use https://webchat.server.org/#converse/ in my link, according to what you wrote about '#', I can't use any class with markdown. I have to use html then. Right?

mahagr commented 4 years ago

@rhukster Can you add a link class in markdown?