Hi Folks,
I may have stumbled upon a Seaside bug.
I am able to turn the "unicode spew" bug on and off at will.
at http://menmachinesmaterials.com/WikitextParser
The middle tab "wikicode" is the culprit.
The code for it is here:
*renderWikicodeOn: html
|src|
wikicode isNil
ifTrue:[src := '== Welcome To WikitextParserBrowser ==']
ifFalse:[src := wikicode].
html break;break.
src class = WideString
ifTrue:[src := 'buggy'].
html preformatted:src*
The following input will blow up the render when the WideString check is
commented out:
*
testmDashThierryIV
"scratch test"
^ ' ''''''Thierry IV'''''' or ''''''Theoderic IV'''''' ({{circa}}
720{{spaced ndash}}c. 782) was a [[Franks|Frankish]] noble. Count of
[[Autun]] and [[Toulouse]]; he was thought to be a son of [[Sigebert V]],
and grandson of [[Sigebert IV of Raze]]. It is now well documented that his
supposed Davidic blood was a hoax (see [[Priory of Sion]]). Thierry married
[[Auda of France|Auda]], daughter of [[Charles Martel]], sister of [[Pepin
III]].
==Children==
*[[William of Gellone]] (755 – 28 May 812/4)
*Alda of Gellone (born ca. 770); married Fredalon
*[[Adalhelm of Autun]]
{{Persondata
| NAME = Thierry 04
| ALTERNATIVE NAMES =
| SHORT DESCRIPTION = Frankish noble
| DATE OF BIRTH =
| PLACE OF BIRTH =
| DATE OF DEATH =
| PLACE OF DEATH =
}}
{{DEFAULTSORT:Thierry 04}}
[[Category:720s births]]
[[Category:780s deaths]]
[[Category:Counts of Autun]]
[[Category:Counts of Toulouse]]
[[Category:Frankish people]]
{{France-noble-stub}}'*
If I leave that check in, then the html renders perfectly, and the Wikicode
tab just displays "buggy"
If I remove that check, the "unicode spew" problem happens.
I have tried several different html tags besides preformatted including
text: html: code: textArea:
None of that made a difference.
The difference between the HTML and WIKICODE display is that the html passes
through the XTreams Parsing and a grammar rule exists that changes the
'mdash' to a simple '-'.
The original Wikicode that is parsed does not have those characters
replaced.
--
Sent from: http://forum.world.st/Seaside-General-f86180.html
Hi All,
I discovered that the "unicode spew" was not what I thought it was.
When the "spew" happens it is because the html output is dumped within the
body tag like this:
<html>
<head></head>
<body><�!DOCTYPE
html><�html><�head><�title>Seaside<�/title><�meta
charset="utf-8"/><�link rel="stylesheet" type="text/css"
href="/files/WADevelopmentFiles/development.css"/><�/head><�body
onload="onLoad()"><�a
href="/waDebug?_s=ccLzvr_77iZO7bVN&amp;_k=KdqQxjU4LkFiBg30&amp;1">standard
dash<�/a>&nbsp;<�a h
</body>
</html>
Its wierd and its a heisenbug.
I created a copy of WACounter , named it WADebug and the callbacks "dash"
and "mdash" totally isolate the Character.
http://menmachinesmaterials.com/waDebug
*renderContentOn: html
html anchor
callback: [ self dash ];
with: 'standard dash'.
html space.
html anchor
callback: [ self ndash ];
with: 'n-dash'.
html break.
html html: count.
dash
count := '-'
ndash
count := (Character value:8211) asString
*
What is really weird is that it works on the server when it did not work on
my workstation.
For some reason, it just started working on my Workstation.
I made a small edit to my Workstation, unrelated to that issue, and it
stopped working.
I am running Seaside on
Squeak5.2
latest update: #18233
Anybody have a clue why it would mangle the output like that?
I will be trying a Pharo install possibly tomorrow to see if that negates
the bug.
cheers.
t
--
Sent from: http://forum.world.st/Seaside-General-f86180.html
Hi All,
I discovered that the "unicode spew" was not what I thought it was.
When the "spew" happens it is because the html output is dumped within the
body tag like this:
<html>
<head></head>
<body><�!DOCTYPE
html><�html><�head><�title>Seaside<�/title><�meta
charset="utf-8"/><�link rel="stylesheet" type="text/css"
href="/files/WADevelopmentFiles/development.css"/><�/head><�body
onload="onLoad()"><�a
href="/waDebug?_s=ccLzvr_77iZO7bVN&amp;_k=KdqQxjU4LkFiBg30&amp;1">standard
dash<�/a>&nbsp;<�a h
</body>
</html>
Its wierd and its a heisenbug.
I created a copy of WACounter , named it WADebug and the callbacks "dash"
and "mdash" totally isolate the Character.
http://menmachinesmaterials.com/waDebug
*renderContentOn: html
html anchor
callback: [ self dash ];
with: 'standard dash'.
html space.
html anchor
callback: [ self ndash ];
with: 'n-dash'.
html break.
html html: count.
dash
count := '-'
ndash
count := (Character value:8211) asString
*
What is really weird is that it works on the server when it did not work on
my workstation.
For some reason, it just started working on my Workstation.
I made a small edit to my Workstation, unrelated to that issue, and it
stopped working.
I am running Seaside on
Squeak5.2
latest update: #18233
Anybody have a clue why it would mangle the output like that?
I will be trying a Pharo install possibly tomorrow to see if that negates
the bug.
cheers.
t
--
Sent from: http://forum.world.st/Seaside-General-f86180.html
Wierd stuff.
The "unicode spew" wasn't what it seemed to be; rather, the final generated
html looked like this:
<html>
<head></head>
<body><�!DOCTYPE
html><�html><�head><�title>Seaside<�/title><�meta
charset="utf-8"/><�link rel="stylesheet" type="text/css"
href="/files/WADevelopmentFiles/development.css"/><�/head><�body
onload="onLoad()"><�a
href="/waDebug?_s=HYflc3WPAZnUmxcX&amp;_k=oAlI2TSho5n4-x6m&amp;1">standard
dash<�/a>&nbsp;<�a h
</body>
</html>
The output was being output to the <body> tag, not the top level.
I isolated the culprit.
Character value: 8211
I Copied and modified the WACounter example as WADebug to generate the
error; the callbacks are 'dash' and 'ndash' instead of 'increase' and
'decrease'
ndash
count := (Character value:8211) asString
dash
count := '-'
http://menmachinesmaterials.com/waDebug
Unfortunately, it works, and I do not know why.
I run the same thing on my local workstation and I get the "unicode spew"
problem.
But wait! it gets weirder still.
When I deployed to the server, where it works, my workstation version
started working too.
Yet, when I saved the method with the demo text under a new method name, the
error returned.
Anybody seen these symptoms before?
thanks in advance.
--
Sent from: http://forum.world.st/Seaside-General-f86180.html
Hi Folks.
Over at http://menmachinesmaterials.com/WikitextParser ***
When hitting HamburgerIcon->Database->Random Page I occasionally get what
I call "Unicode spew"
Here is a portion of a page.
*<�!DOCTYPE html><�html class="no-js" lang="en"
dir="ltr"><�head><�title>WikitextParser<�/title><�meta
charset="utf-8"/><�link rel="stylesheet" type="text/css"
href="/files/WADevelopmentFiles/development.css"/>...*
However, on the image, if I run the page manually, the resulting XMLElement
looks just fine.
Here is the thing that caused the spew.
*<body><p> Thierry IV or Theoderic IV ({{circa}} 720{{spaced ndash}}c. 782)
was a Frankish <https://www.wikipedia.org/wiki/Franks> noble. Count of
Autun <https://www.wikipedia.org/wiki/Autun> and Toulouse
<https://www.wikipedia.org/wiki/Toulouse> ; he was thought to be a son of
Sigebert V <https://www.wikipedia.org/wiki/Sigebert_V> , and grandson of
Sigebert IV of Raze <https://www.wikipedia.org/wiki/Sigebert_IV_of_Raze> .
It is now well documented that his supposed Davidic blood was a hoax (see
Priory of Sion <https://www.wikipedia.org/wiki/Priory_of_Sion> ). Thierry
married Auda <https://www.wikipedia.org/wiki/Auda_of_France> , daughter of
Charles Martel <https://www.wikipedia.org/wiki/Charles_Martel> , sister of
Pepin III <https://www.wikipedia.org/wiki/Pepin_III> .</p>
Children
<ul><li><a
href="https://www.wikipedia.org/wiki/William_of_Gellone">William of
Gellone</a> (755 – 28 May 812/4)</li><li>Alda of Gellone (born ca.
770); married Fredalon</li><li><a
href="https://www.wikipedia.org/wiki/Adalhelm_of_Autun">Adalhelm of
Autun</a></li></ul><p>{{Persondata <div/>| NAME = Thierry
04| ALTERNATIVE NAMES =| SHORT DESCRIPTION = Frankish noble| DATE OF BIRTH
=| PLACE OF BIRTH =| DATE OF DEATH =| PLACE OF DEATH
=}}{{DEFAULTSORT:Thierry 04}} Category:720s births
<https://www.wikipedia.org/wiki/Category:720s_births> Category:780s deaths
<https://www.wikipedia.org/wiki/Category:780s_deaths> Category:Counts of
Autun <https://www.wikipedia.org/wiki/Category:Counts_of_Autun>
Category:Counts of Toulouse
<https://www.wikipedia.org/wiki/Category:Counts_of_Toulouse>
Category:Frankish people
<https://www.wikipedia.org/wiki/Category:Frankish_people>
</p><p>{{France-noble-stub}}</p></body>*
The method that posts the output is straightforward enough:
*renderParsedOn: html
| wikiGrammar wikiParser input actor|
actor := PEGWikiMediaGeneratorTables new.
actor transcripton
ifTrue:[ Transcript clear].
wikicode isNil
ifTrue:[input := '== Welcome To WikitextParserBrowser ==']
ifFalse:[input := wikicode].
wikiGrammar := PEGParser grammarWikiMediaTables reading positioning.
wikiParser := PEGParser parserPEG parse: 'Grammar' stream: wikiGrammar
actor: PEGParserParser new.
[[output := wikiParser parse: 'Page' stream: input actor: actor. ]
on: Error
do:[:ex | output := '
Error parsing. see Wikicode tab for source
']]
ensure:[
output := ((output asString copyReplaceAll: '<body>' with:'' )
copyReplaceTokens:'</body>' with:'') .
output := (output asString copyReplaceAll: '>' with:'>'
asTokens:false).
output := (output asString copyReplaceAll: '<' with:'<'
asTokens:false)].
html break;break.
html html: output.
*
Is there something I should be doing to "output" to make the garbage go
away?
thanks in advance
*** Alpha/Beta dev tool. If you get a DNU just hit the back button and try
again. Please do not hit Debug (:
--
Sent from: http://forum.world.st/Seaside-General-f86180.html