Skip to content

Instantly share code, notes, and snippets.

<subbu> [subbu@earth tests] echo "<pre>&lt;</pre>" | node parse
<subbu> <body data-parsoid='{"dsr":[0,16,0,0]}'><pre data-parsoid='{"stx":"html","dsr":[0,15,5,6]}'><span typeof="mw:Entity" data-parsoid='{"src":"&amp;lt;","srcContent":"&lt;","dsr":[5,9,null,null]}'>&lt;</span></pre>
<subbu> </body>
<subbu> do we need a mw:Entity span for the entity inside a <pre>?
<subbu> it seems like it is unnecessary .. and potentially a problem for the serializer if we just serialize innerHTML for html-pres
[subbu@earth tests] node debug parse --inputfile /tmp/foo --fetchConfig false
< debugger listening on port 5858
connecting... ok
break in parse.js:7
5 */
6
7 var ParserEnv = require('../lib/mediawiki.parser.environment.js').MWParserEnvironment,
8 ParsoidConfig = require( '../lib/mediawiki.ParsoidConfig.js' ).ParsoidConfig,
9 WikitextSerializer = require('../lib/mediawiki.WikitextSerializer.js').WikitextSerializer,
debug> c
[subbu@earth ~/jruby] cat test_it
#!/bin/tcsh
echo "--fib--"
time jruby --server $1 $2 local_benches/bench_fib_recursive.rb
time jruby --server $1 $2 local_benches/bench_fib_recursive.rb
echo "--bm1--"
time jruby --server $1 $2 local_benches/bm1.rb
time jruby --server $1 $2 local_benches/bm1.rb
echo "--gem list--"
[subbu@earth ~/jruby] cat ir.failing.specs
------------------------
/home/subbu/jruby/spec/ruby/language/BEGIN_spec.rb F
/home/subbu/jruby/spec/ruby/language/file_spec.rb F
/home/subbu/jruby/spec/ruby/language/line_spec.rb F
/home/subbu/jruby/spec/ruby/language/return_spec.rb F
/home/subbu/jruby/spec/ruby/core/fiber/resume_spec.rb F
/home/subbu/jruby/spec/ruby/core/kernel/__callee___spec.rb F
/home/subbu/jruby/spec/ruby/core/kernel/__method___spec.rb F
/home/subbu/jruby/spec/ruby/core/kernel/load_spec.rb F
[subbu@earth ~/jruby] find lib -name "*jar"
lib/ruby/shared/ripper.jar
lib/ruby/shared/kryptcore.jar
lib/ruby/shared/jopenssl.jar
lib/ruby/shared/kryptproviderjdk.jar
lib/ruby/shared/bcpkix-jdk15on-1.47.jar
lib/ruby/shared/original-jopenssl.jar
lib/ruby/shared/readline/original-readline.jar
lib/ruby/shared/readline/jline-2.11.jar
lib/ruby/shared/readline/readline.jar
--> A:<span about="#mwt121" class="reference" data-mw="{&quot;name&quot;:&quot;ref&quot;,&quot;body&quot;:{&quot;html&quot;:&quot;<span about=\&quot;#mwt123\&quot; typeof=\&quot;mw:Transclusion\&quot; data-mw='{\&quot;parts\&quot;:[{\&quot;template\&quot;:{\&quot;target\&quot;:{\&quot;wt\&quot;:\&quot;cite web\&quot;,\&quot;href\&quot;:\&quot;./Template:Cite_web\&quot;},\&quot;params\&quot;:{\&quot;url\&quot;:{\&quot;wt\&quot;:\&quot;http://www.zum.de/whkmla/region/germany/bra30.html\&quot;},\&quot;title\&quot;:{\&quot;wt\&quot;:\&quot;Brandenburg during the 30 Years War\&quot;},\&quot;work\&quot;:{\&quot;wt\&quot;:\&quot;WHKMLA\&quot;},\&quot;accessdate\&quot;:{\&quot;wt\&quot;:\&quot;18 August 2008\&quot;}},\&quot;i\&quot;:0}}]}' data-parsoid='{\&quot;dsr\&quot;:[16336,16483,null,null],\&quot;pi\&quot;:[[{\&quot;k\&quot;:\&quot;url\&quot;,\&quot;named\&quot;:true,\&quot;spc\&quot;:[\&quot;\&quot;,\&quot;\&quot;,\&quot;\&quot;,\&quot;\&quot;]},{\&quot;k\&quot;:\&quot;title\&quot;,\&quot;named\&quot;:true,\&q
[subbu@earth tests] node parse --html2wt < /tmp/xyz.html
{|
<th>k6cetj5kudkuik9</th>!!''b''
|''a''||''b''
|}
[subbu@earth tests] cat /tmp/xyz.html
<body data-parsoid="{&quot;dsr&quot;:[0,25,0,0]}"><table data-parsoid="{&quot;dsr&quot;:[0,25,2,2]}">
<tbody data-parsoid="{&quot;dsr&quot;:[3,23,0,0]}"><tr data-parsoid="{&quot;autoInsertedEnd&quot;:true,&quot;autoInsertedStart&quot;:true,&quot;stx&quot;:&quot;html&quot;,&quot;dsr&quot;:[3,22,0,0]}"><th>k6cetj5kudkuik9</th><th data-parsoid="{&quot;stx_v&quot;:&quot;row&quot;,&quot;autoInsertedEnd&quot;:true,&quot;dsr&quot;:[7,12,2,0]}"><i data-parsoid="{&quot;autoInsertedEnd&quot;:1,&quot;dsr&quot;:[9,12,2,0]}">b</i></th>
<td data-parsoid="{&quot;autoInsertedEnd&quot;:true,&quot;dsr&quot;:[13,17,1,0]}"><i data-parsoid="{&quot;autoInsertedEnd&quot;:1,&quot;dsr&quot;:[14,17,2,0]}" data-foobar="dg2oiz9jujev1jor">a</i></td><td data-parsoid="{&quot;stx_v&quot;:&quot;row&quot;,&quot;autoInsertedEnd&quot;:true,&quot;dsr&quot;:[17,22,2,0]}"><i data-parsoid="{&quot;autoIns
[subbu@earth tests] ./sync-parserTests.js ../../../core/ pt-sync
Parsoid git HEAD is e7b19984370b734f058abdc3ecb47582e734f71d
>>> cd ../../../core/
>>> git fetch origin
remote: Counting objects: 15665, done
remote: Finding sources: 100% (2594/2594)
remote: Getting sizes: 100% (677/677)
remote: Compressing objects: 99% (12696/12697)
remote: Total 2594 (delta 1671), reused 2239 (delta 1639)
Receiving objects: 100% (2594/2594), 14.75 MiB | 1.02 MiB/s, done.
[subbu@earth lib] node parse --prefix mw --dump dom:pre-dsr < /tmp/x
------ DOM: pre-DSR -------
<head data-parsoid="{&quot;tmp&quot;:{}}"></head><body data-parsoid="{&quot;tmp&quot;:{}}"><meta typeof="mw:Transclusion" about="#mwt1" data-mw-arginfo="{&quot;dict&quot;:{&quot;target&quot;:{&quot;wt&quot;:&quot;Test for noincludes&quot;,&quot;href&quot;:&quot;./Template:Test_for_noincludes&quot;},&quot;params&quot;:{}},&quot;paramInfos&quot;:[]}" data-parsoid="{&quot;tsr&quot;:[0,23],&quot;src&quot;:&quot;{{Test for noincludes}}&quot;,&quot;a&quot;:{&quot;id&quot;:null},&quot;sa&quot;:{&quot;id&quot;:&quot;mwt1&quot;},&quot;tagId&quot;:1,&quot;tmp&quot;:{}}"><div data-parsoid="{&quot;stx&quot;:&quot;html&quot;,&quot;tagId&quot;:2,&quot;tmp&quot;:{}}">TEST</div>
<p data-parsoid="{&quot;tagId&quot;:3,&quot;tmp&quot;:{}}"><meta typeof="mw:Transclusion/End" about="#mwt1" data-parsoid="{&quot;tsr&quot;:[null,23],&quot;tagId&quot;:4,&quot;tmp&quot;:{}}">Blah number 5</p>
<p data-parsoid="{&quot;tagId&quot;:5,&quot;tm
subbu@earth:~/work/wmf/Parsoid/js/lib$ ls -lt /tmp/*wt* | grep -v tsp
-rw-rw-r-- 1 subbu subbu 381378 Oct 10 13:35 /tmp/wt0
-rw-rw-r-- 1 subbu subbu 381378 Oct 10 13:26 /tmp/wt3
-rw-rw-r-- 1 subbu subbu 381354 Oct 10 13:26 /tmp/wt2
-rw-rw-r-- 1 subbu subbu 381338 Oct 10 13:25 /tmp/wt1
-rw-rw-r-- 1 subbu subbu 1780653 Oct 10 13:13 /tmp/wt.debug3.html
-rw-rw-r-- 1 subbu subbu 2276378 Oct 10 12:16 /tmp/wt.debug2.html
-rw-rw-r-- 1 subbu subbu 2380992 Oct 10 12:09 /tmp/wt.debug1.html
-rw-rw-r-- 1 subbu subbu 2116581 Oct 10 11:59 /tmp/wt.debug.html