sweble / sweble-wikitext

The Sweble Wikitext Components module provides a parser for MediaWiki's wikitext and an engine trying to emulate the behavior of a MediaWiki.
http://sweble.org/sites/swc-devel/develop-latest/tooling/sweble/sweble-wikitext
70 stars 27 forks source link

Parser fails on tables with indentation colons #57

Open gartentrio opened 7 years ago

gartentrio commented 7 years ago

Tables with leading indentation colons are not parsed correctly. See example from article https://de.wikipedia.org/wiki/Actinium?action=raw:

:{| class="wikitable" style="text-align:center"
! Formel
! Farbe
! Symmetrie
! [[Raumgruppe]]
! [[Pearson-Symbol]]
! ''a'' (pm)
! ''b'' (pm)
! ''c'' (pm)
! ''Z''
! Dichte,<br />g/cm<sup>3</sup>
|-
| Ac
| silber
| ''fcc''<ref name="ach">J. D. Farr, A. L. Giorgi, M. G. Bowman, R. K. Money: „The crystal structure of actinium metal and actinium hydride“, in: ''[[Journal of Inorganic and Nuclear Chemistry]]'', '''1961''', ''18'', S.&nbsp;42–47 ([[doi:10.1016/0022-1902(61)80369-2]]).</ref>
| {{Raumgruppe|Fm-3m|kurz}}
| cF4
| 531,1
| 531,1
| 531,1
| 4
| 10,07
|-
| AcH<sub>2</sub>
|
| kubisch<ref name="ach" />
| {{Raumgruppe|Fm-3m|kurz}}
| cF12
| 567
| 567
| 567
| 4
| 8,35
|-
| Ac<sub>2</sub>O<sub>3</sub>
| weiß<ref name="blueglow" />
| trigonal<ref name="aco">W. H. Zachariasen: „Crystal Chemical Studies of the 5''f''-Series of Elements. XII. New Compounds Representing known Structure Types“, in: ''[[Acta Crystallographica]]'', '''1949''', ''2'', S.&nbsp;388–390 ([[doi:10.1107/S0365110X49001016]]).</ref>
| {{Raumgruppe|P-3m1|kurz}}
| hP5
| 408
| 408
| 630
| 1
| 9,18
|-
| Ac<sub>2</sub>S<sub>3</sub>
|
| kubisch<ref name="acs">W. H. Zachariasen: „Crystal Chemical Studies of the 5''f''-Series of Elements. VI. The Ce<sub>2</sub>S<sub>3</sub>–Ce<sub>3</sub>S<sub>4</sub> Type of Structure“, in: ''[[Acta Crystallographica]]'', '''1949''', ''2'', S.&nbsp;57–60 ([[doi:10.1107/S0365110X49000126]]).</ref>
| {{Raumgruppe|I-43d|kurz}}
| cI28
| 778,56
| 778,56
| 778,56
| 4
| 6,71
|-
| AcF<sub>3</sub>
| weiß<ref name="m71">Gerd Meyer, Lester R. Morss: ''Synthesis of lanthanide and actinide compounds'', Springer, 1991, ISBN 0-7923-1018-7, S.&nbsp;71 ({{Google Buch|BuchID=bnS5elHL2w8C|Seite=71}}).</ref>
| hexagonal<ref name="aco" /><ref name="j2" />
| {{Raumgruppe|P-3c1|kurz}}
| hP24
| 741
| 741
| 755
| 6
| 7,88
|-
| AcCl<sub>3</sub>
|
| hexagonal<ref name="accl">W. H. Zachariasen: „Crystal Chemical Studies of the 5''f''-Series of Elements. I. New Structure Types“, in: ''[[Acta Crystallographica]]'', '''1948''', ''1'', S.&nbsp;265–268 ([[doi:10.1107/S0365110X48000703]]).</ref><ref name="j2" />
| {{Raumgruppe|P63/m|kurz}}
| hP8
| 764
| 764
| 456
| 2
| 4,8
|-
| AcBr<sub>3</sub>
| weiß<ref name="j2" />
| hexagonal<ref name="accl" />
| {{Raumgruppe|P63/m|kurz}}
| hP8
| 764
| 764
| 456
| 2
| 5,85
|-
| AcOF
| weiß<ref name="m87">Gerd Meyer, Lester R. Morss: ''Synthesis of lanthanide and actinide compounds'', Springer, 1991, ISBN 0-7923-1018-7, S.&nbsp;87–88 ({{Google Buch|BuchID=bnS5elHL2w8C|Seite=87}}).</ref>
| kubisch<ref name="j2" />
| {{Raumgruppe|Fm-3m|kurz}}
|
| 593,1
|
|
|
| 8,28
|-
| AcOCl
|
| tetragonal<ref name="j2" />
|
|
| 424
| 424
| 707
|
| 7,23
|-
| AcOBr
|
| tetragonal<ref name="j2" />
|
|
| 427
| 427
| 740
|
| 7,89
|-
| AcPO<sub>4</sub> · 0,5 H<sub>2</sub>O
|
| hexagonal<ref name="j2" />
|
|
| 721
| 721
| 664
|
| 5,48
|}
kno10 commented 7 years ago

Another example is "Komplette Fortschrittstabelle" at https://de.wikipedia.org/w/index.php?title=Schacholympiade_1994&oldid=161991782

Here, the table was also indented (probably for aesthetic reasons), with :{|, and it appears as if Sweble does not recognize and parse this table.