OpenEuphoria.org
Ticket #64:
Preview style not same as actual style
-
Reported by
mattlewis
Sep 13, 2009
When previewing, the styles used appear to be different, especially with respect to eucode or triple bracket blocks of text. After the comment/post/etc is submitted, these blocks appear inside a colored block. When previewing, no such block exists.
The preview should be as faithful as possible to the actual, final display.
Details
1. Comment by mattlewis
Aug 10, 2010
I think forum post previewing was fixed in svn:3339. Needs to be confirmed, and if so, a similar fix should be applied to ticket and news previews.
2. Comment by jimcbrown
Aug 10, 2010
The fix is now on the test forum.
3. Comment by DerekParnell
Aug 10, 2010
And the test forum's URL is ... ???
4. Comment by jimcbrown
Aug 10, 2010
http://demonology.redirectme.net/forum.wc
5. Comment by mattlewis
Aug 10, 2010
Lots of links on the test forum are giving me the error that Derek reported in a comment on ticket:178:
Internal Error
Fatal run-time error:
c_proc/c_func: bad routine number (-1)
6. Comment by jimcbrown
Aug 10, 2010
The real issue appears to be a problem in creole.e - I'm getting a type check failure with a sequence whose first element is -98.
See http://demonology.redirectme.net/creole.err
7. Comment by mattlewis
Aug 10, 2010
The line numbers are a little off. Is this running the creole.e in the head of the euweb repository?
In any case, following the traceback, it looks like the errant -98 came from html_gen.e:html_generator(). I don't see anything obvious in that routine, however, that looks like it would do that.
8. Comment by jimcbrown
Aug 10, 2010
I've implemented a very dirty hack in creole.e (after trying and failing to understand the cause of the issue in creole.e) to workaround the creole.e bug. Probably not a proper fix but everything seems to work now.
9. Comment by DerekParnell
Aug 10, 2010
Hmmm ... creole or regex? The problem is that re:find() demands that the 'haystack' be a byte array (only integers in the range 0 - 255), but creole uses an object array. It's been using the object array forever so some change in regex has tripped this bug.
I guess I'll change creole to not use regex anymore.
10. Comment by jimcbrown
Aug 10, 2010
It was svn head with a few minor insertions of "end loop" lines. This was done ages ago back when the test forum ran with a much older version of Euphoria that didn't support optional end loop, and automatically merged in after each update.
11. Comment by mattlewis
Aug 10, 2010
Yeah, I can see why non-text values wouldn't work with a regex. Derek, do you have any idea where that -98 was coming from?
12. Comment by jimcbrown
Aug 10, 2010
regex uses PCRE, which uses C char arrays as its strings, so the 0-255 byte limitation makes sense and should have always been present. (It might have been a long standing bug of regex.e to not validate the strings it passed to the C later until recently, though...)
13. Comment by DerekParnell
Aug 10, 2010
The -98 is the value of the enum TAG_STARTPARA. It is used as a place marker in the text. It is legitimate from creole's POV so I'll rewrite the calls to re:find() as custom routines.
Of course, it makes sense that regex works this way due to it's dependance on PCRE. Pity its not a Euphoria-aware DLL
14. Comment by jimcbrown
Aug 10, 2010
So how are we looking on the original bug on this ticket?
15. Comment by mattlewis
Aug 10, 2010
The pre blocks are now getting the correct style on the post and edit pages. Now we need to update the ticket preview, too.
16. Comment by mattlewis
Sep 06, 2010
Updated the style sheet to properly preview triple brackets and eucode on the create ticket form in svn:3401.
17. Comment by jeremy
Oct 26, 2010
What is the status of this ticket?
18. Comment by jeremy
Nov 05, 2010
See svn:3869 for the details. This is as good as it will get, only difference is a bit more narrow of a view, thus some differences are possible.