Jump to content
Science Forums

Recommended Posts

Posted

In a quick search, I couldn’t find this discussed... A single instance of a backslash in a quote tag gets stripped when submitted (or previewed) leading to latex havoc:

 

http://hypography.com/forums/test-forum/6620-latex-practice-ground-4.html#post227837

 

To add to confusion, this doesn’t happen in the bug tracker / project forum:

 

Latex breaks in quotes - Science Forums - Project Tools

 

This has lead to quite a bit of yammering:

 

http://hypography.com/forums/philosophy-science/11733-what-can-we-know-reality-28.html#post227829

 

http://hypography.com/forums/astronomy-cosmology/15389-universal-scale-2.html#post227338

 

Thank you,

 

~modest

  • 1 month later...
Posted

working on it. it seems that vblatex plugin has not had any updates for the past year+ so that will have to stay where it's at (and honestly i think it works pretty well)

 

so i am working on probably adding a something to the quote parser...

 

now to remember my passwords to get into the server :phones:

Posted

a couple of hours of digging through endless lines of code... and i finally found where the quote text is being parsed... well... sort of

 

function handle_bbcode_quote($message, $username = '')
       {
               global $vbulletin, $vbphrase, $stylevar, $show;

               // remove smilies from username                                                                                                                                                                                             
               $username = $this->strip_smilies($username);
               if (preg_match('/^(.+)(?<![0-9]{3}|[0-9]{4}|[0-9]{5});\s*(\d+)\s*$/U', $username, $match))
               {
                       $username = $match[1];
                       $postid = $match[2];
               }
               else
               {
                       $postid = 0;
               }

               $username = $this->do_word_wrap($username);

               $show['username'] = iif($username != '', true, false);
               $message = $this->strip_front_back_whitespace($message, 1);

               if ($this->options['cachable'] == false)
               {
                       $show['iewidthfix'] = (is_browser('ie') AND !(is_browser('ie', 6)));
               }
               else
               {
                       // this post may be cached, so we can't allow this "fix" to be included in that cache                                                                                                                               
                       $show['iewidthfix'] = false;
               }

               $template = $this->printable ? 'bbcode_quote_printable' : 'bbcode_quote';
               eval('$html = "' . fetch_template($template) . '";');
               return $html;
       }

only problem being that it doesn't strip slashes there... but i wonder if i write a tiny addon to this to say look for [math] tags inside and add an extra slash, before it runs through this function... dunno

 

wait, oh crap, it wont work php tags have to unremove the htmlspecialchared bits, and i think thats where the stripping occurs.... shizer :( ... wait ;)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...