Not logged in. · Lost password · Register
Forum: General Help and Support General Stuff RSS
Why does DW parse a page twice in order to render it ?
Avatar
schplurtz (Moderator) #1
Member since Nov 2009 · 183 posts · Location: France, Finistère
Group memberships: Global Moderators, Members
Show profile · Link to this post
Subject: Why does DW parse a page twice in order to render it ?
Hi,

I'm currently writing a simple syntax plugin, I noticed that the "handle" method is called twice with same input. Debug makes me think this is happening :

parse, render preview_metadata, parse, render xhtml

I'm curious, why parse twice ? It seems to me that the second parsing could be avoided. There must be some good reason that I just can't figure out.

Edit:
I could not find an explanation in the devel section of the wiki.
http://schplurtz.free.fr/wiki/
Avatar
Klap-in #2
Member since Nov 2009 · 236 posts · Location: Alkmaar, The Netherlands
Group memberships: Documentation Team, Members
Show profile · Link to this post
Do you have other plugins installed?

Does the pattern of your plugin match to more snippets in your test page, such that it is called for every match?
Avatar
schplurtz (Moderator) #3
Member since Nov 2009 · 183 posts · Location: France, Finistère
Group memberships: Global Moderators, Members
Show profile · Link to this post
Yes I have other plugins.  I'm going to retry without any plugin, on a fresh installation. and I'll come back.
Thanks for the suggestion.
http://schplurtz.free.fr/wiki/
Avatar
schplurtz (Moderator) #4
Member since Nov 2009 · 183 posts · Location: France, Finistère
Group memberships: Global Moderators, Members
Show profile · Link to this post
Subject: still twice, but not exactly as I thought
Brand new wiki from github, zero plugin and a minimalistic syntax/substitution plugin (attached) : text between <tag> </tag> in wiki page is rendered as <pre></pre> in html. The code logs everything in file /tmp/y.

It appears I misunderstood what is happening, but the page is still parsed twice.
When I save a page, here is what happens

parse, render metadata, render xhtml, parse, render metadata.

Again, I'm just curious.


When I save this
====== test ======
<tag>
bla ble bliiii
</tag>

I get this log
-----
connecting to mode base
connecting to mode listblock
connecting to mode table
connecting to mode footnote
connecting to mode quote
handling LEXER_ENTER {{<tag>}} args : >><<
handling CONTENT >>
bla ble bliii
<<
handling LEXER_EXIT
rendering for format metadata  state: >><<
rendering for format metadata
bla ble bli state: >><<
rendering for format metadata  state: >><<
rendering for format xhtml  state: >>1<<
rendering for format xhtml
bla ble bli state: >>3<<
rendering for format xhtml  state: >>4<<
-----
connecting to mode base
connecting to mode listblock
connecting to mode table
connecting to mode footnote
connecting to mode quote
handling LEXER_ENTER {{<tag>}} args : >><<
handling CONTENT >>
bla ble bliii
<<
handling LEXER_EXIT
rendering for format metadata  state: >><<
rendering for format metadata
bla ble bli state: >><<
rendering for format metadata  state: >><<
http://schplurtz.free.fr/wiki/
The author has attached one file to this post:
exampsyn.zip 2.4 kBytes
You have no permission to open this file.
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Go to forum
Imprint
This board is powered by the Unclassified NewsBoard software, 20150713-dev, © 2003-2015 by Yves Goergen
Current time: 2017-05-24, 19:41:37 (UTC +02:00)