Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

How to disable @ linking within code tag

JasonBarnabeJasonBarnabe Cynical Salamander ✭✭
edited May 2014 in Vanilla 2.0 - 2.8

When using code or pre tags, @ should not create a link (@JasonBarnabe). How do I disable this?

If there's no way to do this, can someone at least point me to the code that does this or even the name of this feature? Searching for "@ or at" isn't giving me much, obviously.

Tagged:

Best Answer

Answers

  • peregrineperegrine MVP
    edited May 2014

    you know the drill or should.

    what version of vanilla? what editor?

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • JasonBarnabeJasonBarnabe Cynical Salamander ✭✭

    Vanilla 2.1. I haven't changed the editor so... default?

  • peregrineperegrine MVP
    edited May 2014

    as an aside another feature using hashtags (a # in front of a word as long as it not first character on line, which automarks words with a #hashtags (or e.g. #markdown and clicking sends you to search.

    $Configuration['Garden']['Format']['Hashtags'] = TRUE;
    $Configuration['Garden']['Format']['Hashtags'] = FALSE;


    idiosyncracies with hashtags

    firstcharacter - is a # therefore it uses #markdown instead of #hashtag

    #firstcharacter is a # therefore it uses #markdown instead of #hashtag

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • JasonBarnabeJasonBarnabe Cynical Salamander ✭✭

    Thanks for the info. Sounds like I'll have to muck around. I'll share the solution if I come up with one.

    This forum has the same problem, it's just your inclusion of " immediately before the @ that prevented it.

  • peregrineperegrine MVP
    edited May 2014

    This forum has the same problem, it's just your inclusion of " immediately before the @ that prevented it.

    // test
    
    @include minion
    
    
    // end test
    

    you might have to look in js as well

    I haven't tried geshi plugin - maybe you would have better luck (but maybe not).

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • JasonBarnabeJasonBarnabe Cynical Salamander ✭✭

    I see that @include as a link...

  • peregrineperegrine MVP
    edited May 2014

    so do i :)

    It won't be for the faint hearted because you have to back reference to see if @ is within a pre or code tag.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • peregrineperegrine MVP
    edited May 2014

    it might be simpler to change if you want to exclude certain @mentions altogether.

    e.g. you could exclude @include and any other @ related to code and let usernames evaluate as is.

    or you could may change the preg_replace to also search for <code or <pre. and >pre or >code closing tags.seems like alot of trouble for the benefit.

    or maybe validate against against an existing username in the database before changing to an anchor.

    lines around 1162 in Mentions routine in class.format.php

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

Sign In or Register to comment.