Open lpaulsen93 opened 6 years ago
I also noticed that this problem is causing invalid HTML code.
I also noticed that this problem is causing invalid HTML code.
Example?
As for the difference in color output, that's a result of the fact that code directly parsed by geshi does not convert the double quotes to right and left unicode double quotes. If you want consistency use single quotes; they are not, it seems, converted.
I checked the html and see the issue. I also found the source of the problem. It may take a bit of prestidigitation to fix it, if at all. I'll keep you informed.
I guess it would be fixed automatically if the encoding issue was fixed. I wonder where that comes from. Did you find the source of that? I did not see any conversion in the DokuWiki core functions code
or file
. I thought they maybe would do some conversion before calling p_xhtml_cached_geshi()
but they don't. Maybe I did oversee something.
I've looked at the html again, and I don't think it is boken. This seems to me correct:
“Hello World<span class="sy0">!</span>”
The spans govern the exclamation mark, and the closed quotation mark goes outside the span because it is not being highlighted.
The quotation mark conversion is done in the parser handler. I can change the doublequote conversion back to normal, but it has no affect on the syntax color. I assume that's because the conversion precedes the geshi highlighting. Geshi is simply responding to what it finds in the text.
My firefox marked it as invalid but maybe that's a bug in firefox: I assume as per HTML standard only realy ASCII double quotes need to be escaped but I have to check.
Right! I had the wrong pType.. which determines how paragraphs are handled. I wrote this plugin 7 years ago can't recall my reasoning but had set the pType to 'normal' instead of block. Just uploaded the fix.
And I have a fix for the "encoding" issue but I am not sure if it would break other stuff. If you change
function getAllowedTypes() {
return array('substition');
}
to
function getAllowedTypes() {
return array('formatting');
}
then the highlighting result will be the same as generated by the DokuWiki core. I did'nt test if the new highlighting mode you implemented still works with this change.
For some reason highlighted code generated from
codedoc
tags looks different than highlighted code generated from DokuWiki's corecode
tags. E.g. the following example causes different results also the source code is the same:This is strange as the codedoc plugin just calls
p_xhtml_cached_geshi()
. I noticed that the"
around theHello World!
strings are different. It seems to be an encoding problem but I could not find the source of the problem yet.