We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22797
    • 134 Posts
    I noticed that when someone submits a list of URLs in a comment using Jot, the code inserts spaces in random places for all of the URLs after the first one. For example, if I list three URLs, the first one will be fine, but the rest will have a space in the URL somewhere, effectively breaking the URL. I assume this is there for anti-spam and anti-linking purposes, so that people won’t spam the site with links that they hope search engines will find.

    That’s a handy feature, but I want to turn it off. How can I turn it off?
      • 4195
      • 398 Posts
      it’s not a feature, but I think it has something to do with the phx:length modifier...
      it will break a line longer than 60characters with a space.. omit the :length modifier and you’re fine.
        Armand Pondman
        MODx Coding Team
        :: Jot :: PHx
        • 22797
        • 134 Posts
        Ok. I removed the "wordwrap" modifier in the comment chunk, which worked. It used to say:

        <div class="jot-message">[+comment.content:wordwrap:esc:nl2br+]</div>

        Now it says:

        <div class="jot-message">[+comment.content:esc:nl2br+]</div>

        The URLs themselves were not more than 70 characters long (this was the length set in the Jot snippet for wrapping) -- They were actually rather short, but because I had three URLs listed, it treated them like one long line of text, even though each one was listed on a new line. The person who submitted the comment had hit "enter" in between the URLs, so the resulting code looked like this, complete with line breaks (due to the nl2br modifier, I presume):

        http://[domain here]/dsadler/about_me.html

        http://[domain here]/ dsadler/goal_statement.html

        http://[domain here]/dsadler/xhtml_samp ler.html

        (I removed the domain to preserve privacy.) But notice that there are spaces in the 2nd and 3rd URLs. The lines themselves are not over 70 characters, from one
        to the next, but the parser is treating them as if they were all one long line.

        This is an issue that ought to be addressed in future versions of the parser code.

        Thanks for helping me find out what was wrong.
          • 4195
          • 398 Posts
          thanks for pointing this one out... i guess i have a good understanding what is happening here.. will try to fix asap, it’s a phx thing wink
            Armand Pondman
            MODx Coding Team
            :: Jot :: PHx
            • 4195
            • 398 Posts
            in phx.parser.class.inc.php line ~252 replace the whole wordwrap case with:

            case "wordwrap": // default: 70
              $wrapat = intval($modifier_value[$i]) ? intval($modifier_value[$i]) : 70;
              $output = preg_replace("~(\b\w+\b)~e","wordwrap('\\1',\$wrapat,' ',1)",$output);
              break;
            


            wordwrap will now only wrap words longer than specified lengh and not complete strings.
            This fix will be available in next phx and jot versions.
              Armand Pondman
              MODx Coding Team
              :: Jot :: PHx