stacks / stacks-website

The website for the Stacks project
http://stacks.math.columbia.edu
GNU General Public License v2.0
19 stars 12 forks source link

A reference in tag 01F7 isn't parsed #26

Closed pbelmans closed 11 years ago

pbelmans commented 11 years ago

It's a mystery for now, but whereas the first reference in tag 01FB is parsed correctly it is just plaintext in its enclosing section, which is tag 01F7. Things seem to be working correctly otherwise, so I'm confused.

aisejohan commented 11 years ago

Hi, I tried to make some headway on this bug. My feeling is that it has something to do with accents; I haven't so far been able to get to the bottom of it. But I have a question. The line

$code = preg_replace('/&lt;a href=&quot;\/([A-Za-z0-9\/\-]+)&quot;&gt;([A-Za-z0-9\-]+)&lt;\/a&gt;/', '<a href="' . href("") . '$1">$2</a>', $code);

in the function preprocessCode seems to be setup intentionally to not parse correctly the internal references in the LaTeX (which have now been mangled by the call to htmlentities)? It is easy to fix this (by removing the first escaped slash). Anyway, later (in both use cases of preprocessCode) there is an additional preg_replace to fix these internal references. I think this is just too confusing.

Also, you can remove lines 136 and 137 (because we fixed 01YC).

Anyway, can you add some comments explaining how the functions convertLaTeX and preprocessCode are supposed to work and how they are supposed to be used?