annotate MoinMoin/converter/text_html_text_moin_wiki.py @ 4020:b1e192a3651a SOC2008-END

converter doesn't remove first line of preformated text when it's not empty
author Byeongweon [tasyblue@gmail.com]
date Tue, 19 Aug 2008 03:05:36 +0900
parents 73e64899e511
children e5a5b2797a6a 07862b0663fd
rev   line source
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1 """
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
2 MoinMoin - convert from html to wiki markup
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
3
2771
1134a5cc12c2 gui converter fixes for new markup, fix/extend tests, remove unused code
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2728
diff changeset
4 @copyright: 2005-2006 Bastian Blank, Florian Festi, Reimar Bauer,
1134a5cc12c2 gui converter fixes for new markup, fix/extend tests, remove unused code
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2728
diff changeset
5 2005-2007 MoinMoin:ThomasWaldmann
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
6 @license: GNU GPL, see COPYING for details.
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
7 """
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
8
488
fa890b814205 added some ExpatError debug log code
Thomas Waldmann <tw@waldmann-edv.de>
parents: 452
diff changeset
9 import re, os
1879
dec60e485e49 minidom parse tree nodes need .has_key()
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1868
diff changeset
10 import xml.dom.minidom # HINT: the nodes in parse result tree need .has_key(), "x in ..." does not work
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
11 from xml.dom import Node
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
12
1914
eb68960b1dfb remove unused imports
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1908
diff changeset
13 from MoinMoin import config, wikiutil
1908
8bd4b581cc60 make converter pluggable, dynamically load correct converter, move loading of parser to send_page_content
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1886
diff changeset
14 from MoinMoin.error import ConvertError
48
8a37de5a6b79 fixed broken tests package, moved ConvertError to convert module
Nir Soffer <nirs@freeshell.org>
parents: 37
diff changeset
15
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
16 # Portions (C) International Organization for Standardization 1986
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
17 # Permission to copy in any form is granted for use with
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
18 # conforming SGML systems and applications as defined in
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
19 # ISO 8879, provided this notice is included in all copies.
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
20 dtd = ur'''
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
21 <!DOCTYPE html [
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
22 <!ENTITY nbsp "&#32;"> <!-- no-break space = non-breaking space, U+00A0, convert to U+0020 -->
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
23 <!ENTITY iexcl "&#161;"> <!-- inverted exclamation mark, U+00A1 ISOnum -->
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
24 <!ENTITY cent "&#162;"> <!-- cent sign, U+00A2 ISOnum -->
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
25 <!ENTITY pound "&#163;"> <!-- pound sign, U+00A3 ISOnum -->
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
26 <!ENTITY curren "&#164;"> <!-- currency sign, U+00A4 ISOnum -->
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
27 <!ENTITY yen "&#165;"> <!-- yen sign = yuan sign, U+00A5 ISOnum -->
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
28 <!ENTITY brvbar "&#166;"> <!-- broken bar = broken vertical bar, U+00A6 ISOnum -->
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
29 <!ENTITY sect "&#167;"> <!-- section sign, U+00A7 ISOnum -->
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
30 <!ENTITY uml "&#168;"> <!-- diaeresis = spacing diaeresis, U+00A8 ISOdia -->
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
31 <!ENTITY copy "&#169;"> <!-- copyright sign, U+00A9 ISOnum -->
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
32 <!ENTITY ordf "&#170;"> <!-- feminine ordinal indicator, U+00AA ISOnum -->
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
33 <!ENTITY laquo "&#171;"> <!-- left-pointing double angle quotation mark = left pointing guillemet, U+00AB ISOnum -->
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
34 <!ENTITY not "&#172;"> <!-- not sign = angled dash, U+00AC ISOnum -->
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
35 <!ENTITY shy "&#173;"> <!-- soft hyphen = discretionary hyphen, U+00AD ISOnum -->
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
36 <!ENTITY reg "&#174;"> <!-- registered sign = registered trade mark sign, U+00AE ISOnum -->
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
37 <!ENTITY macr "&#175;"> <!-- macron = spacing macron = overline = APL overbar, U+00AF ISOdia -->
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
38 <!ENTITY deg "&#176;"> <!-- degree sign, U+00B0 ISOnum -->
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
39 <!ENTITY plusmn "&#177;"> <!-- plus-minus sign = plus-or-minus sign, U+00B1 ISOnum -->
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
40 <!ENTITY sup2 "&#178;"> <!-- superscript two = superscript digit two = squared, U+00B2 ISOnum -->
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
41 <!ENTITY sup3 "&#179;"> <!-- superscript three = superscript digit three = cubed, U+00B3 ISOnum -->
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
42 <!ENTITY acute "&#180;"> <!-- acute accent = spacing acute, U+00B4 ISOdia -->
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
43 <!ENTITY micro "&#181;"> <!-- micro sign, U+00B5 ISOnum -->
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
44 <!ENTITY para "&#182;"> <!-- pilcrow sign = paragraph sign, U+00B6 ISOnum -->
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
45 <!ENTITY middot "&#183;"> <!-- middle dot = Georgian comma = Greek middle dot, U+00B7 ISOnum -->
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
46 <!ENTITY cedil "&#184;"> <!-- cedilla = spacing cedilla, U+00B8 ISOdia -->
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
47 <!ENTITY sup1 "&#185;"> <!-- superscript one = superscript digit one, U+00B9 ISOnum -->
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
48 <!ENTITY ordm "&#186;"> <!-- masculine ordinal indicator, U+00BA ISOnum -->
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
49 <!ENTITY raquo "&#187;"> <!-- right-pointing double angle quotation mark = right pointing guillemet, U+00BB ISOnum -->
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
50 <!ENTITY frac14 "&#188;"> <!-- vulgar fraction one quarter = fraction one quarter, U+00BC ISOnum -->
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
51 <!ENTITY frac12 "&#189;"> <!-- vulgar fraction one half = fraction one half, U+00BD ISOnum -->
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
52 <!ENTITY frac34 "&#190;"> <!-- vulgar fraction three quarters = fraction three quarters, U+00BE ISOnum -->
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
53 <!ENTITY iquest "&#191;"> <!-- inverted question mark = turned question mark, U+00BF ISOnum -->
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
54 <!ENTITY Agrave "&#192;"> <!-- latin capital letter A with grave = latin capital letter A grave, U+00C0 ISOlat1 -->
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
55 <!ENTITY Aacute "&#193;"> <!-- latin capital letter A with acute, U+00C1 ISOlat1 -->
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
56 <!ENTITY Acirc "&#194;"> <!-- latin capital letter A with circumflex, U+00C2 ISOlat1 -->
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
57 <!ENTITY Atilde "&#195;"> <!-- latin capital letter A with tilde, U+00C3 ISOlat1 -->
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
58 <!ENTITY Auml "&#196;"> <!-- latin capital letter A with diaeresis, U+00C4 ISOlat1 -->
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
59 <!ENTITY Aring "&#197;"> <!-- latin capital letter A with ring above = latin capital letter A ring, U+00C5 ISOlat1 -->
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
60 <!ENTITY AElig "&#198;"> <!-- latin capital letter AE = latin capital ligature AE, U+00C6 ISOlat1 -->
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
61 <!ENTITY Ccedil "&#199;"> <!-- latin capital letter C with cedilla, U+00C7 ISOlat1 -->
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
62 <!ENTITY Egrave "&#200;"> <!-- latin capital letter E with grave, U+00C8 ISOlat1 -->
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
63 <!ENTITY Eacute "&#201;"> <!-- latin capital letter E with acute, U+00C9 ISOlat1 -->
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
64 <!ENTITY Ecirc "&#202;"> <!-- latin capital letter E with circumflex, U+00CA ISOlat1 -->
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
65 <!ENTITY Euml "&#203;"> <!-- latin capital letter E with diaeresis, U+00CB ISOlat1 -->
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
66 <!ENTITY Igrave "&#204;"> <!-- latin capital letter I with grave, U+00CC ISOlat1 -->
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
67 <!ENTITY Iacute "&#205;"> <!-- latin capital letter I with acute, U+00CD ISOlat1 -->
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
68 <!ENTITY Icirc "&#206;"> <!-- latin capital letter I with circumflex, U+00CE ISOlat1 -->
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
69 <!ENTITY Iuml "&#207;"> <!-- latin capital letter I with diaeresis, U+00CF ISOlat1 -->
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
70 <!ENTITY ETH "&#208;"> <!-- latin capital letter ETH, U+00D0 ISOlat1 -->
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
71 <!ENTITY Ntilde "&#209;"> <!-- latin capital letter N with tilde, U+00D1 ISOlat1 -->
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
72 <!ENTITY Ograve "&#210;"> <!-- latin capital letter O with grave, U+00D2 ISOlat1 -->
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
73 <!ENTITY Oacute "&#211;"> <!-- latin capital letter O with acute, U+00D3 ISOlat1 -->
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
74 <!ENTITY Ocirc "&#212;"> <!-- latin capital letter O with circumflex, U+00D4 ISOlat1 -->
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
75 <!ENTITY Otilde "&#213;"> <!-- latin capital letter O with tilde, U+00D5 ISOlat1 -->
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
76 <!ENTITY Ouml "&#214;"> <!-- latin capital letter O with diaeresis, U+00D6 ISOlat1 -->
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
77 <!ENTITY times "&#215;"> <!-- multiplication sign, U+00D7 ISOnum -->
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
78 <!ENTITY Oslash "&#216;"> <!-- latin capital letter O with stroke = latin capital letter O slash, U+00D8 ISOlat1 -->
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
79 <!ENTITY Ugrave "&#217;"> <!-- latin capital letter U with grave, U+00D9 ISOlat1 -->
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
80 <!ENTITY Uacute "&#218;"> <!-- latin capital letter U with acute, U+00DA ISOlat1 -->
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
81 <!ENTITY Ucirc "&#219;"> <!-- latin capital letter U with circumflex, U+00DB ISOlat1 -->
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
82 <!ENTITY Uuml "&#220;"> <!-- latin capital letter U with diaeresis, U+00DC ISOlat1 -->
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
83 <!ENTITY Yacute "&#221;"> <!-- latin capital letter Y with acute, U+00DD ISOlat1 -->
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
84 <!ENTITY THORN "&#222;"> <!-- latin capital letter THORN, U+00DE ISOlat1 -->
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
85 <!ENTITY szlig "&#223;"> <!-- latin small letter sharp s = ess-zed, U+00DF ISOlat1 -->
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
86 <!ENTITY agrave "&#224;"> <!-- latin small letter a with grave = latin small letter a grave, U+00E0 ISOlat1 -->
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
87 <!ENTITY aacute "&#225;"> <!-- latin small letter a with acute, U+00E1 ISOlat1 -->
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
88 <!ENTITY acirc "&#226;"> <!-- latin small letter a with circumflex, U+00E2 ISOlat1 -->
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
89 <!ENTITY atilde "&#227;"> <!-- latin small letter a with tilde, U+00E3 ISOlat1 -->
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
90 <!ENTITY auml "&#228;"> <!-- latin small letter a with diaeresis, U+00E4 ISOlat1 -->
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
91 <!ENTITY aring "&#229;"> <!-- latin small letter a with ring above = latin small letter a ring, U+00E5 ISOlat1 -->
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
92 <!ENTITY aelig "&#230;"> <!-- latin small letter ae = latin small ligature ae, U+00E6 ISOlat1 -->
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
93 <!ENTITY ccedil "&#231;"> <!-- latin small letter c with cedilla, U+00E7 ISOlat1 -->
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
94 <!ENTITY egrave "&#232;"> <!-- latin small letter e with grave, U+00E8 ISOlat1 -->
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
95 <!ENTITY eacute "&#233;"> <!-- latin small letter e with acute, U+00E9 ISOlat1 -->
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
96 <!ENTITY ecirc "&#234;"> <!-- latin small letter e with circumflex, U+00EA ISOlat1 -->
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
97 <!ENTITY euml "&#235;"> <!-- latin small letter e with diaeresis, U+00EB ISOlat1 -->
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
98 <!ENTITY igrave "&#236;"> <!-- latin small letter i with grave, U+00EC ISOlat1 -->
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
99 <!ENTITY iacute "&#237;"> <!-- latin small letter i with acute, U+00ED ISOlat1 -->
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
100 <!ENTITY icirc "&#238;"> <!-- latin small letter i with circumflex, U+00EE ISOlat1 -->
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
101 <!ENTITY iuml "&#239;"> <!-- latin small letter i with diaeresis, U+00EF ISOlat1 -->
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
102 <!ENTITY eth "&#240;"> <!-- latin small letter eth, U+00F0 ISOlat1 -->
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
103 <!ENTITY ntilde "&#241;"> <!-- latin small letter n with tilde, U+00F1 ISOlat1 -->
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
104 <!ENTITY ograve "&#242;"> <!-- latin small letter o with grave, U+00F2 ISOlat1 -->
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
105 <!ENTITY oacute "&#243;"> <!-- latin small letter o with acute, U+00F3 ISOlat1 -->
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
106 <!ENTITY ocirc "&#244;"> <!-- latin small letter o with circumflex, U+00F4 ISOlat1 -->
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
107 <!ENTITY otilde "&#245;"> <!-- latin small letter o with tilde, U+00F5 ISOlat1 -->
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
108 <!ENTITY ouml "&#246;"> <!-- latin small letter o with diaeresis, U+00F6 ISOlat1 -->
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
109 <!ENTITY divide "&#247;"> <!-- division sign, U+00F7 ISOnum -->
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
110 <!ENTITY oslash "&#248;"> <!-- latin small letter o with stroke, = latin small letter o slash, U+00F8 ISOlat1 -->
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
111 <!ENTITY ugrave "&#249;"> <!-- latin small letter u with grave, U+00F9 ISOlat1 -->
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
112 <!ENTITY uacute "&#250;"> <!-- latin small letter u with acute, U+00FA ISOlat1 -->
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
113 <!ENTITY ucirc "&#251;"> <!-- latin small letter u with circumflex, U+00FB ISOlat1 -->
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
114 <!ENTITY uuml "&#252;"> <!-- latin small letter u with diaeresis, U+00FC ISOlat1 -->
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
115 <!ENTITY yacute "&#253;"> <!-- latin small letter y with acute, U+00FD ISOlat1 -->
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
116 <!ENTITY thorn "&#254;"> <!-- latin small letter thorn, U+00FE ISOlat1 -->
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
117 <!ENTITY yuml "&#255;"> <!-- latin small letter y with diaeresis, U+00FF ISOlat1 -->
151
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
118
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
119 <!-- Latin Extended-B -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
120 <!ENTITY fnof "&#402;"> <!-- latin small f with hook = function = florin, U+0192 ISOtech -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
121
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
122 <!-- Greek -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
123 <!ENTITY Alpha "&#913;"> <!-- greek capital letter alpha, U+0391 -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
124 <!ENTITY Beta "&#914;"> <!-- greek capital letter beta, U+0392 -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
125 <!ENTITY Gamma "&#915;"> <!-- greek capital letter gamma,
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
126 U+0393 ISOgrk3 -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
127 <!ENTITY Delta "&#916;"> <!-- greek capital letter delta,
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
128 U+0394 ISOgrk3 -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
129 <!ENTITY Epsilon "&#917;"> <!-- greek capital letter epsilon, U+0395 -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
130 <!ENTITY Zeta "&#918;"> <!-- greek capital letter zeta, U+0396 -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
131 <!ENTITY Eta "&#919;"> <!-- greek capital letter eta, U+0397 -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
132 <!ENTITY Theta "&#920;"> <!-- greek capital letter theta,
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
133 U+0398 ISOgrk3 -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
134 <!ENTITY Iota "&#921;"> <!-- greek capital letter iota, U+0399 -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
135 <!ENTITY Kappa "&#922;"> <!-- greek capital letter kappa, U+039A -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
136 <!ENTITY Lambda "&#923;"> <!-- greek capital letter lambda,
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
137 U+039B ISOgrk3 -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
138 <!ENTITY Mu "&#924;"> <!-- greek capital letter mu, U+039C -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
139 <!ENTITY Nu "&#925;"> <!-- greek capital letter nu, U+039D -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
140 <!ENTITY Xi "&#926;"> <!-- greek capital letter xi, U+039E ISOgrk3 -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
141 <!ENTITY Omicron "&#927;"> <!-- greek capital letter omicron, U+039F -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
142 <!ENTITY Pi "&#928;"> <!-- greek capital letter pi, U+03A0 ISOgrk3 -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
143 <!ENTITY Rho "&#929;"> <!-- greek capital letter rho, U+03A1 -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
144 <!-- there is no Sigmaf, and no U+03A2 character either -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
145 <!ENTITY Sigma "&#931;"> <!-- greek capital letter sigma,
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
146 U+03A3 ISOgrk3 -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
147 <!ENTITY Tau "&#932;"> <!-- greek capital letter tau, U+03A4 -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
148 <!ENTITY Upsilon "&#933;"> <!-- greek capital letter upsilon,
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
149 U+03A5 ISOgrk3 -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
150 <!ENTITY Phi "&#934;"> <!-- greek capital letter phi,
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
151 U+03A6 ISOgrk3 -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
152 <!ENTITY Chi "&#935;"> <!-- greek capital letter chi, U+03A7 -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
153 <!ENTITY Psi "&#936;"> <!-- greek capital letter psi,
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
154 U+03A8 ISOgrk3 -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
155 <!ENTITY Omega "&#937;"> <!-- greek capital letter omega,
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
156 U+03A9 ISOgrk3 -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
157
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
158 <!ENTITY alpha "&#945;"> <!-- greek small letter alpha,
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
159 U+03B1 ISOgrk3 -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
160 <!ENTITY beta "&#946;"> <!-- greek small letter beta, U+03B2 ISOgrk3 -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
161 <!ENTITY gamma "&#947;"> <!-- greek small letter gamma,
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
162 U+03B3 ISOgrk3 -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
163 <!ENTITY delta "&#948;"> <!-- greek small letter delta,
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
164 U+03B4 ISOgrk3 -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
165 <!ENTITY epsilon "&#949;"> <!-- greek small letter epsilon,
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
166 U+03B5 ISOgrk3 -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
167 <!ENTITY zeta "&#950;"> <!-- greek small letter zeta, U+03B6 ISOgrk3 -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
168 <!ENTITY eta "&#951;"> <!-- greek small letter eta, U+03B7 ISOgrk3 -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
169 <!ENTITY theta "&#952;"> <!-- greek small letter theta,
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
170 U+03B8 ISOgrk3 -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
171 <!ENTITY iota "&#953;"> <!-- greek small letter iota, U+03B9 ISOgrk3 -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
172 <!ENTITY kappa "&#954;"> <!-- greek small letter kappa,
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
173 U+03BA ISOgrk3 -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
174 <!ENTITY lambda "&#955;"> <!-- greek small letter lambda,
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
175 U+03BB ISOgrk3 -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
176 <!ENTITY mu "&#956;"> <!-- greek small letter mu, U+03BC ISOgrk3 -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
177 <!ENTITY nu "&#957;"> <!-- greek small letter nu, U+03BD ISOgrk3 -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
178 <!ENTITY xi "&#958;"> <!-- greek small letter xi, U+03BE ISOgrk3 -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
179 <!ENTITY omicron "&#959;"> <!-- greek small letter omicron, U+03BF NEW -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
180 <!ENTITY pi "&#960;"> <!-- greek small letter pi, U+03C0 ISOgrk3 -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
181 <!ENTITY rho "&#961;"> <!-- greek small letter rho, U+03C1 ISOgrk3 -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
182 <!ENTITY sigmaf "&#962;"> <!-- greek small letter final sigma,
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
183 U+03C2 ISOgrk3 -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
184 <!ENTITY sigma "&#963;"> <!-- greek small letter sigma,
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
185 U+03C3 ISOgrk3 -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
186 <!ENTITY tau "&#964;"> <!-- greek small letter tau, U+03C4 ISOgrk3 -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
187 <!ENTITY upsilon "&#965;"> <!-- greek small letter upsilon,
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
188 U+03C5 ISOgrk3 -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
189 <!ENTITY phi "&#966;"> <!-- greek small letter phi, U+03C6 ISOgrk3 -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
190 <!ENTITY chi "&#967;"> <!-- greek small letter chi, U+03C7 ISOgrk3 -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
191 <!ENTITY psi "&#968;"> <!-- greek small letter psi, U+03C8 ISOgrk3 -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
192 <!ENTITY omega "&#969;"> <!-- greek small letter omega,
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
193 U+03C9 ISOgrk3 -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
194 <!ENTITY thetasym "&#977;"> <!-- greek small letter theta symbol,
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
195 U+03D1 NEW -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
196 <!ENTITY upsih "&#978;"> <!-- greek upsilon with hook symbol,
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
197 U+03D2 NEW -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
198 <!ENTITY piv "&#982;"> <!-- greek pi symbol, U+03D6 ISOgrk3 -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
199
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
200 <!-- General Punctuation -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
201 <!ENTITY bull "&#8226;"> <!-- bullet = black small circle,
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
202 U+2022 ISOpub -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
203 <!-- bullet is NOT the same as bullet operator, U+2219 -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
204 <!ENTITY hellip "&#8230;"> <!-- horizontal ellipsis = three dot leader,
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
205 U+2026 ISOpub -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
206 <!ENTITY prime "&#8242;"> <!-- prime = minutes = feet, U+2032 ISOtech -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
207 <!ENTITY Prime "&#8243;"> <!-- double prime = seconds = inches,
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
208 U+2033 ISOtech -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
209 <!ENTITY oline "&#8254;"> <!-- overline = spacing overscore,
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
210 U+203E NEW -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
211 <!ENTITY frasl "&#8260;"> <!-- fraction slash, U+2044 NEW -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
212
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
213 <!-- Letterlike Symbols -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
214 <!ENTITY weierp "&#8472;"> <!-- script capital P = power set
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
215 = Weierstrass p, U+2118 ISOamso -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
216 <!ENTITY image "&#8465;"> <!-- blackletter capital I = imaginary part,
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
217 U+2111 ISOamso -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
218 <!ENTITY real "&#8476;"> <!-- blackletter capital R = real part symbol,
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
219 U+211C ISOamso -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
220 <!ENTITY trade "&#8482;"> <!-- trade mark sign, U+2122 ISOnum -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
221 <!ENTITY alefsym "&#8501;"> <!-- alef symbol = first transfinite cardinal,
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
222 U+2135 NEW -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
223 <!-- alef symbol is NOT the same as hebrew letter alef,
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
224 U+05D0 although the same glyph could be used to depict both characters -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
225
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
226 <!-- Arrows -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
227 <!ENTITY larr "&#8592;"> <!-- leftwards arrow, U+2190 ISOnum -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
228 <!ENTITY uarr "&#8593;"> <!-- upwards arrow, U+2191 ISOnum-->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
229 <!ENTITY rarr "&#8594;"> <!-- rightwards arrow, U+2192 ISOnum -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
230 <!ENTITY darr "&#8595;"> <!-- downwards arrow, U+2193 ISOnum -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
231 <!ENTITY harr "&#8596;"> <!-- left right arrow, U+2194 ISOamsa -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
232 <!ENTITY crarr "&#8629;"> <!-- downwards arrow with corner leftwards
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
233 = carriage return, U+21B5 NEW -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
234 <!ENTITY lArr "&#8656;"> <!-- leftwards double arrow, U+21D0 ISOtech -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
235 <!-- ISO 10646 does not say that lArr is the same as the 'is implied by' arrow
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
236 but also does not have any other character for that function. So ? lArr can
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
237 be used for 'is implied by' as ISOtech suggests -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
238 <!ENTITY uArr "&#8657;"> <!-- upwards double arrow, U+21D1 ISOamsa -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
239 <!ENTITY rArr "&#8658;"> <!-- rightwards double arrow,
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
240 U+21D2 ISOtech -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
241 <!-- ISO 10646 does not say this is the 'implies' character but does not have
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
242 another character with this function so ?
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
243 rArr can be used for 'implies' as ISOtech suggests -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
244 <!ENTITY dArr "&#8659;"> <!-- downwards double arrow, U+21D3 ISOamsa -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
245 <!ENTITY hArr "&#8660;"> <!-- left right double arrow,
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
246 U+21D4 ISOamsa -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
247
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
248 <!-- Mathematical Operators -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
249 <!ENTITY forall "&#8704;"> <!-- for all, U+2200 ISOtech -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
250 <!ENTITY part "&#8706;"> <!-- partial differential, U+2202 ISOtech -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
251 <!ENTITY exist "&#8707;"> <!-- there exists, U+2203 ISOtech -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
252 <!ENTITY empty "&#8709;"> <!-- empty set = null set = diameter,
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
253 U+2205 ISOamso -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
254 <!ENTITY nabla "&#8711;"> <!-- nabla = backward difference,
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
255 U+2207 ISOtech -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
256 <!ENTITY isin "&#8712;"> <!-- element of, U+2208 ISOtech -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
257 <!ENTITY notin "&#8713;"> <!-- not an element of, U+2209 ISOtech -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
258 <!ENTITY ni "&#8715;"> <!-- contains as member, U+220B ISOtech -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
259 <!-- should there be a more memorable name than 'ni'? -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
260 <!ENTITY prod "&#8719;"> <!-- n-ary product = product sign,
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
261 U+220F ISOamsb -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
262 <!-- prod is NOT the same character as U+03A0 'greek capital letter pi' though
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
263 the same glyph might be used for both -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
264 <!ENTITY sum "&#8721;"> <!-- n-ary sumation, U+2211 ISOamsb -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
265 <!-- sum is NOT the same character as U+03A3 'greek capital letter sigma'
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
266 though the same glyph might be used for both -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
267 <!ENTITY minus "&#8722;"> <!-- minus sign, U+2212 ISOtech -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
268 <!ENTITY lowast "&#8727;"> <!-- asterisk operator, U+2217 ISOtech -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
269 <!ENTITY radic "&#8730;"> <!-- square root = radical sign,
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
270 U+221A ISOtech -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
271 <!ENTITY prop "&#8733;"> <!-- proportional to, U+221D ISOtech -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
272 <!ENTITY infin "&#8734;"> <!-- infinity, U+221E ISOtech -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
273 <!ENTITY ang "&#8736;"> <!-- angle, U+2220 ISOamso -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
274 <!ENTITY and "&#8743;"> <!-- logical and = wedge, U+2227 ISOtech -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
275 <!ENTITY or "&#8744;"> <!-- logical or = vee, U+2228 ISOtech -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
276 <!ENTITY cap "&#8745;"> <!-- intersection = cap, U+2229 ISOtech -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
277 <!ENTITY cup "&#8746;"> <!-- union = cup, U+222A ISOtech -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
278 <!ENTITY int "&#8747;"> <!-- integral, U+222B ISOtech -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
279 <!ENTITY there4 "&#8756;"> <!-- therefore, U+2234 ISOtech -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
280 <!ENTITY sim "&#8764;"> <!-- tilde operator = varies with = similar to,
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
281 U+223C ISOtech -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
282 <!-- tilde operator is NOT the same character as the tilde, U+007E,
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
283 although the same glyph might be used to represent both -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
284 <!ENTITY cong "&#8773;"> <!-- approximately equal to, U+2245 ISOtech -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
285 <!ENTITY asymp "&#8776;"> <!-- almost equal to = asymptotic to,
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
286 U+2248 ISOamsr -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
287 <!ENTITY ne "&#8800;"> <!-- not equal to, U+2260 ISOtech -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
288 <!ENTITY equiv "&#8801;"> <!-- identical to, U+2261 ISOtech -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
289 <!ENTITY le "&#8804;"> <!-- less-than or equal to, U+2264 ISOtech -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
290 <!ENTITY ge "&#8805;"> <!-- greater-than or equal to,
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
291 U+2265 ISOtech -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
292 <!ENTITY sub "&#8834;"> <!-- subset of, U+2282 ISOtech -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
293 <!ENTITY sup "&#8835;"> <!-- superset of, U+2283 ISOtech -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
294 <!-- note that nsup, 'not a superset of, U+2283' is not covered by the Symbol
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
295 font encoding and is not included. Should it be, for symmetry?
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
296 It is in ISOamsn -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
297 <!ENTITY nsub "&#8836;"> <!-- not a subset of, U+2284 ISOamsn -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
298 <!ENTITY sube "&#8838;"> <!-- subset of or equal to, U+2286 ISOtech -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
299 <!ENTITY supe "&#8839;"> <!-- superset of or equal to,
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
300 U+2287 ISOtech -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
301 <!ENTITY oplus "&#8853;"> <!-- circled plus = direct sum,
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
302 U+2295 ISOamsb -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
303 <!ENTITY otimes "&#8855;"> <!-- circled times = vector product,
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
304 U+2297 ISOamsb -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
305 <!ENTITY perp "&#8869;"> <!-- up tack = orthogonal to = perpendicular,
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
306 U+22A5 ISOtech -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
307 <!ENTITY sdot "&#8901;"> <!-- dot operator, U+22C5 ISOamsb -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
308 <!-- dot operator is NOT the same character as U+00B7 middle dot -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
309
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
310 <!-- Miscellaneous Technical -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
311 <!ENTITY lceil "&#8968;"> <!-- left ceiling = apl upstile,
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
312 U+2308 ISOamsc -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
313 <!ENTITY rceil "&#8969;"> <!-- right ceiling, U+2309 ISOamsc -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
314 <!ENTITY lfloor "&#8970;"> <!-- left floor = apl downstile,
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
315 U+230A ISOamsc -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
316 <!ENTITY rfloor "&#8971;"> <!-- right floor, U+230B ISOamsc -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
317 <!ENTITY lang "&#9001;"> <!-- left-pointing angle bracket = bra,
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
318 U+2329 ISOtech -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
319 <!-- lang is NOT the same character as U+003C 'less than'
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
320 or U+2039 'single left-pointing angle quotation mark' -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
321 <!ENTITY rang "&#9002;"> <!-- right-pointing angle bracket = ket,
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
322 U+232A ISOtech -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
323 <!-- rang is NOT the same character as U+003E 'greater than'
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
324 or U+203A 'single right-pointing angle quotation mark' -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
325
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
326 <!-- Geometric Shapes -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
327 <!ENTITY loz "&#9674;"> <!-- lozenge, U+25CA ISOpub -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
328
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
329 <!-- Miscellaneous Symbols -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
330 <!ENTITY spades "&#9824;"> <!-- black spade suit, U+2660 ISOpub -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
331 <!-- black here seems to mean filled as opposed to hollow -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
332 <!ENTITY clubs "&#9827;"> <!-- black club suit = shamrock,
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
333 U+2663 ISOpub -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
334 <!ENTITY hearts "&#9829;"> <!-- black heart suit = valentine,
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
335 U+2665 ISOpub -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
336 <!ENTITY diams "&#9830;"> <!-- black diamond suit, U+2666 ISOpub -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
337
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
338 <!-- C0 Controls and Basic Latin -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
339 <!ENTITY quot "&#34;"> <!-- quotation mark = APL quote,
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
340 U+0022 ISOnum -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
341 <!ENTITY amp "&#38;"> <!-- ampersand, U+0026 ISOnum -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
342 <!ENTITY lt "&#60;"> <!-- less-than sign, U+003C ISOnum -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
343 <!ENTITY gt "&#62;"> <!-- greater-than sign, U+003E ISOnum -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
344
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
345 <!-- Latin Extended-A -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
346 <!ENTITY OElig "&#338;"> <!-- latin capital ligature OE,
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
347 U+0152 ISOlat2 -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
348 <!ENTITY oelig "&#339;"> <!-- latin small ligature oe, U+0153 ISOlat2 -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
349 <!-- ligature is a misnomer, this is a separate character in some languages -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
350 <!ENTITY Scaron "&#352;"> <!-- latin capital letter S with caron,
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
351 U+0160 ISOlat2 -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
352 <!ENTITY scaron "&#353;"> <!-- latin small letter s with caron,
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
353 U+0161 ISOlat2 -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
354 <!ENTITY Yuml "&#376;"> <!-- latin capital letter Y with diaeresis,
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
355 U+0178 ISOlat2 -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
356
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
357 <!-- Spacing Modifier Letters -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
358 <!ENTITY circ "&#710;"> <!-- modifier letter circumflex accent,
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
359 U+02C6 ISOpub -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
360 <!ENTITY tilde "&#732;"> <!-- small tilde, U+02DC ISOdia -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
361
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
362 <!-- General Punctuation -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
363 <!ENTITY ensp "&#8194;"> <!-- en space, U+2002 ISOpub -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
364 <!ENTITY emsp "&#8195;"> <!-- em space, U+2003 ISOpub -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
365 <!ENTITY thinsp "&#8201;"> <!-- thin space, U+2009 ISOpub -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
366 <!ENTITY zwnj "&#8204;"> <!-- zero width non-joiner,
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
367 U+200C NEW RFC 2070 -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
368 <!ENTITY zwj "&#8205;"> <!-- zero width joiner, U+200D NEW RFC 2070 -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
369 <!ENTITY lrm "&#8206;"> <!-- left-to-right mark, U+200E NEW RFC 2070 -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
370 <!ENTITY rlm "&#8207;"> <!-- right-to-left mark, U+200F NEW RFC 2070 -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
371 <!ENTITY ndash "&#8211;"> <!-- en dash, U+2013 ISOpub -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
372 <!ENTITY mdash "&#8212;"> <!-- em dash, U+2014 ISOpub -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
373 <!ENTITY lsquo "&#8216;"> <!-- left single quotation mark,
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
374 U+2018 ISOnum -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
375 <!ENTITY rsquo "&#8217;"> <!-- right single quotation mark,
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
376 U+2019 ISOnum -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
377 <!ENTITY sbquo "&#8218;"> <!-- single low-9 quotation mark, U+201A NEW -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
378 <!ENTITY ldquo "&#8220;"> <!-- left double quotation mark,
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
379 U+201C ISOnum -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
380 <!ENTITY rdquo "&#8221;"> <!-- right double quotation mark,
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
381 U+201D ISOnum -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
382 <!ENTITY bdquo "&#8222;"> <!-- double low-9 quotation mark, U+201E NEW -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
383 <!ENTITY dagger "&#8224;"> <!-- dagger, U+2020 ISOpub -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
384 <!ENTITY Dagger "&#8225;"> <!-- double dagger, U+2021 ISOpub -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
385 <!ENTITY permil "&#8240;"> <!-- per mille sign, U+2030 ISOtech -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
386 <!ENTITY lsaquo "&#8249;"> <!-- single left-pointing angle quotation mark,
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
387 U+2039 ISO proposed -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
388 <!-- lsaquo is proposed but not yet ISO standardized -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
389 <!ENTITY rsaquo "&#8250;"> <!-- single right-pointing angle quotation mark,
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
390 U+203A ISO proposed -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
391 <!-- rsaquo is proposed but not yet ISO standardized -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
392 <!ENTITY euro "&#8364;"> <!-- euro sign, U+20AC NEW -->
226b379bde22 added missing HTML entities to the text_html_text_x_moin converter
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 101
diff changeset
393
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
394 ]>
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
395 '''
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
396
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
397 class visitor(object):
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
398 def do(self, tree):
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
399 self.visit_node_list(tree.childNodes)
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
400
188
3b15ec7497bb fixed GUI editor crash on save, some cosmetical changes
Thomas Waldmann <tw@waldmann-edv.de>
parents: 151
diff changeset
401 def visit_node_list(self, nodelist):
3b15ec7497bb fixed GUI editor crash on save, some cosmetical changes
Thomas Waldmann <tw@waldmann-edv.de>
parents: 151
diff changeset
402 for node in nodelist:
3b15ec7497bb fixed GUI editor crash on save, some cosmetical changes
Thomas Waldmann <tw@waldmann-edv.de>
parents: 151
diff changeset
403 self.visit(node)
19
6772e845059d fix for gecko paste link brokenness, src cosmetics
Thomas Waldmann <tw@waldmann-edv.de>
parents: 10
diff changeset
404
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
405 def visit(self, node):
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
406 nodeType = node.nodeType
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
407 if node.nodeType == Node.ELEMENT_NODE:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
408 return self.visit_element(node)
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
409 elif node.nodeType == Node.ATTRIBUTE_NODE:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
410 return self.visit_attribute(node)
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
411 elif node.nodeType == Node.TEXT_NODE:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
412 return self.visit_text(node)
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
413 elif node.nodeType == Node.CDATA_SECTION_NODE:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
414 return self.visit_cdata_section(node)
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
415
19
6772e845059d fix for gecko paste link brokenness, src cosmetics
Thomas Waldmann <tw@waldmann-edv.de>
parents: 10
diff changeset
416 def visit_element(self, node):
6772e845059d fix for gecko paste link brokenness, src cosmetics
Thomas Waldmann <tw@waldmann-edv.de>
parents: 10
diff changeset
417 if len(node.childNodes):
6772e845059d fix for gecko paste link brokenness, src cosmetics
Thomas Waldmann <tw@waldmann-edv.de>
parents: 10
diff changeset
418 self.visit_node_list(node.childNodes)
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
419
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
420 def visit_attribute(self, node):
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
421 pass
999
97ce857bdebf whitespace-only cleanup and minor style changes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 878
diff changeset
422
19
6772e845059d fix for gecko paste link brokenness, src cosmetics
Thomas Waldmann <tw@waldmann-edv.de>
parents: 10
diff changeset
423 def visit_text(self, node):
6772e845059d fix for gecko paste link brokenness, src cosmetics
Thomas Waldmann <tw@waldmann-edv.de>
parents: 10
diff changeset
424 pass
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
425
19
6772e845059d fix for gecko paste link brokenness, src cosmetics
Thomas Waldmann <tw@waldmann-edv.de>
parents: 10
diff changeset
426 def visit_cdata_section(self, node):
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
427 pass
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
428
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
429
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
430 class strip_whitespace(visitor):
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
431
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
432 def visit_element(self, node):
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
433 if node.localName == 'p':
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
434 # XXX: our formatter adds a whitespace at the end of each paragraph
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
435 if node.hasChildNodes() and node.childNodes[-1].nodeType == Node.TEXT_NODE:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
436 data = node.childNodes[-1].data.rstrip('\n ')
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
437 # Remove it if empty
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
438 if data == '':
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
439 node.removeChild(node.childNodes[-1])
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
440 else:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
441 node.childNodes[-1].data = data
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
442 # Remove empty paragraphs
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
443 if not node.hasChildNodes():
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
444 node.parentNode.removeChild(node)
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
445
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
446 if node.hasChildNodes():
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
447 self.visit_node_list(node.childNodes)
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
448
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
449
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
450 class convert_tree(visitor):
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
451 white_space = object()
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
452 new_line = object()
1736
6e4acd9904d7 fix wrong merging of significant newline chars (fixes wrong removal of empty lines in pre sections, fixes wrong merging of tables separates by empty line, fixes wrong removal of li/ol gaps, add empty line after lists)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1725
diff changeset
453 new_line_dont_remove = object()
854
a71bcc0f27c3 fixed MoinMoinBugs:GuiEditorDeletesNewBulletText
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 834
diff changeset
454
19
6772e845059d fix for gecko paste link brokenness, src cosmetics
Thomas Waldmann <tw@waldmann-edv.de>
parents: 10
diff changeset
455 def __init__(self, request, pagename):
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
456 self.request = request
19
6772e845059d fix for gecko paste link brokenness, src cosmetics
Thomas Waldmann <tw@waldmann-edv.de>
parents: 10
diff changeset
457 self.pagename = pagename
999
97ce857bdebf whitespace-only cleanup and minor style changes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 878
diff changeset
458
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
459 def do(self, tree):
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
460 self.depth = 0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
461 self.text = []
428
f4d09019cbb8 fixed MoinMoinBugs/ProcessInlineDontSupportUlElement, some converter code cleanup
Thomas Waldmann <tw@waldmann-edv.de>
parents: 407
diff changeset
462 self.visit(tree.documentElement)
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
463 self.check_whitespace()
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
464 return ''.join(self.text)
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
465
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
466 def check_whitespace(self):
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
467 i = 0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
468 text = self.text
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
469 while i < len(text):
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
470 if text[i] is self.white_space:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
471 if i == 0 or i == len(text)-1:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
472 del text[i]
275
8236b972ea7d better use .startswith/.endswith instead of [0]/[-1]
Thomas Waldmann <tw@waldmann-edv.de>
parents: 258
diff changeset
473 elif text[i-1].endswith(" ") or text[i-1].endswith("\n"):
215
86fafd465ab1 GUI editor: fixed spaces in URLs and whitespace handling
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 188
diff changeset
474 # last char of previous element is whitespace
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
475 del text[i]
215
86fafd465ab1 GUI editor: fixed spaces in URLs and whitespace handling
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 188
diff changeset
476 elif (text[i+1] is self.white_space or
86fafd465ab1 GUI editor: fixed spaces in URLs and whitespace handling
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 188
diff changeset
477 # next element is white_space
86fafd465ab1 GUI editor: fixed spaces in URLs and whitespace handling
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 188
diff changeset
478 text[i+1] is self.new_line):
86fafd465ab1 GUI editor: fixed spaces in URLs and whitespace handling
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 188
diff changeset
479 # or new_line
86fafd465ab1 GUI editor: fixed spaces in URLs and whitespace handling
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 188
diff changeset
480 del text[i]
275
8236b972ea7d better use .startswith/.endswith instead of [0]/[-1]
Thomas Waldmann <tw@waldmann-edv.de>
parents: 258
diff changeset
481 elif text[i+1].startswith(" ") or text[i+1].startswith("\n"):
215
86fafd465ab1 GUI editor: fixed spaces in URLs and whitespace handling
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 188
diff changeset
482 # first char of next element is whitespace
188
3b15ec7497bb fixed GUI editor crash on save, some cosmetical changes
Thomas Waldmann <tw@waldmann-edv.de>
parents: 151
diff changeset
483 del text[i]
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
484 else:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
485 text[i] = " "
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
486 i += 1
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
487 elif text[i] is self.new_line:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
488 if i == 0:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
489 del text[i]
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
490 elif i == len(text) - 1:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
491 text[i] = "\n"
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
492 i += 1
275
8236b972ea7d better use .startswith/.endswith instead of [0]/[-1]
Thomas Waldmann <tw@waldmann-edv.de>
parents: 258
diff changeset
493 elif text[i-1].endswith("\n") or (
8236b972ea7d better use .startswith/.endswith instead of [0]/[-1]
Thomas Waldmann <tw@waldmann-edv.de>
parents: 258
diff changeset
494 isinstance(text[i+1], str) and text[i+1].startswith("\n")):
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
495 del text[i]
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
496 else:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
497 text[i] = "\n"
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
498 i += 1
1736
6e4acd9904d7 fix wrong merging of significant newline chars (fixes wrong removal of empty lines in pre sections, fixes wrong merging of tables separates by empty line, fixes wrong removal of li/ol gaps, add empty line after lists)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1725
diff changeset
499 elif text[i] is self.new_line_dont_remove:
6e4acd9904d7 fix wrong merging of significant newline chars (fixes wrong removal of empty lines in pre sections, fixes wrong merging of tables separates by empty line, fixes wrong removal of li/ol gaps, add empty line after lists)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1725
diff changeset
500 text[i] = "\n"
6e4acd9904d7 fix wrong merging of significant newline chars (fixes wrong removal of empty lines in pre sections, fixes wrong merging of tables separates by empty line, fixes wrong removal of li/ol gaps, add empty line after lists)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1725
diff changeset
501 i += 1
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
502 else:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
503 i += 1
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
504
428
f4d09019cbb8 fixed MoinMoinBugs/ProcessInlineDontSupportUlElement, some converter code cleanup
Thomas Waldmann <tw@waldmann-edv.de>
parents: 407
diff changeset
505 def visit_text(self, node):
f4d09019cbb8 fixed MoinMoinBugs/ProcessInlineDontSupportUlElement, some converter code cleanup
Thomas Waldmann <tw@waldmann-edv.de>
parents: 407
diff changeset
506 self.text.append(node.data)
f4d09019cbb8 fixed MoinMoinBugs/ProcessInlineDontSupportUlElement, some converter code cleanup
Thomas Waldmann <tw@waldmann-edv.de>
parents: 407
diff changeset
507
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
508 def visit_element(self, node):
276
9b21b7907167 this should fix MoinMoinBugs/GuiEditorTypeErrorWhenSaving
Thomas Waldmann <tw@waldmann-edv.de>
parents: 275
diff changeset
509 name = node.localName
9b21b7907167 this should fix MoinMoinBugs/GuiEditorTypeErrorWhenSaving
Thomas Waldmann <tw@waldmann-edv.de>
parents: 275
diff changeset
510 if name is None: # not sure this can happen here (DOM comment node), but just for the case
9b21b7907167 this should fix MoinMoinBugs/GuiEditorTypeErrorWhenSaving
Thomas Waldmann <tw@waldmann-edv.de>
parents: 275
diff changeset
511 return
999
97ce857bdebf whitespace-only cleanup and minor style changes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 878
diff changeset
512 func = getattr(self, "process_%s" % name, None)
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
513 if func:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
514 func(node)
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
515 else:
216
5654512900ca GUI editor: fixed traceback for inline elements outside <p>
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 215
diff changeset
516 self.process_inline(node)
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
517
188
3b15ec7497bb fixed GUI editor crash on save, some cosmetical changes
Thomas Waldmann <tw@waldmann-edv.de>
parents: 151
diff changeset
518 def visit_node_list_element_only(self, nodelist):
3b15ec7497bb fixed GUI editor crash on save, some cosmetical changes
Thomas Waldmann <tw@waldmann-edv.de>
parents: 151
diff changeset
519 for node in nodelist:
3b15ec7497bb fixed GUI editor crash on save, some cosmetical changes
Thomas Waldmann <tw@waldmann-edv.de>
parents: 151
diff changeset
520 if node.nodeType == Node.ELEMENT_NODE:
3b15ec7497bb fixed GUI editor crash on save, some cosmetical changes
Thomas Waldmann <tw@waldmann-edv.de>
parents: 151
diff changeset
521 self.visit_element(node)
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
522
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
523 def node_list_text_only(self, nodelist):
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
524 result = []
188
3b15ec7497bb fixed GUI editor crash on save, some cosmetical changes
Thomas Waldmann <tw@waldmann-edv.de>
parents: 151
diff changeset
525 for node in nodelist:
3b15ec7497bb fixed GUI editor crash on save, some cosmetical changes
Thomas Waldmann <tw@waldmann-edv.de>
parents: 151
diff changeset
526 if node.nodeType == Node.TEXT_NODE:
3b15ec7497bb fixed GUI editor crash on save, some cosmetical changes
Thomas Waldmann <tw@waldmann-edv.de>
parents: 151
diff changeset
527 result.append(node.data)
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
528 else:
188
3b15ec7497bb fixed GUI editor crash on save, some cosmetical changes
Thomas Waldmann <tw@waldmann-edv.de>
parents: 151
diff changeset
529 result.extend(self.node_list_text_only(node.childNodes))
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
530 return "".join(result)
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
531
2862
8c1d40768df7 gedit formatter/converter: fix links/transclusion (suppressing default alt texts needs more work)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2852
diff changeset
532 def get_desc(self, nodelist):
8c1d40768df7 gedit formatter/converter: fix links/transclusion (suppressing default alt texts needs more work)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2852
diff changeset
533 """ links can have either text or an image as description - we extract
8c1d40768df7 gedit formatter/converter: fix links/transclusion (suppressing default alt texts needs more work)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2852
diff changeset
534 this from the child nodelist and return wiki markup.
8c1d40768df7 gedit formatter/converter: fix links/transclusion (suppressing default alt texts needs more work)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2852
diff changeset
535 """
8c1d40768df7 gedit formatter/converter: fix links/transclusion (suppressing default alt texts needs more work)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2852
diff changeset
536 markup = ''
8c1d40768df7 gedit formatter/converter: fix links/transclusion (suppressing default alt texts needs more work)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2852
diff changeset
537 text = self.node_list_text_only(nodelist).replace("\n", " ").strip()
8c1d40768df7 gedit formatter/converter: fix links/transclusion (suppressing default alt texts needs more work)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2852
diff changeset
538 if text:
8c1d40768df7 gedit formatter/converter: fix links/transclusion (suppressing default alt texts needs more work)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2852
diff changeset
539 # found some text
8c1d40768df7 gedit formatter/converter: fix links/transclusion (suppressing default alt texts needs more work)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2852
diff changeset
540 markup = text
8c1d40768df7 gedit formatter/converter: fix links/transclusion (suppressing default alt texts needs more work)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2852
diff changeset
541 else:
8c1d40768df7 gedit formatter/converter: fix links/transclusion (suppressing default alt texts needs more work)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2852
diff changeset
542 # search for an img / object
8c1d40768df7 gedit formatter/converter: fix links/transclusion (suppressing default alt texts needs more work)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2852
diff changeset
543 for node in nodelist:
8c1d40768df7 gedit formatter/converter: fix links/transclusion (suppressing default alt texts needs more work)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2852
diff changeset
544 if node.nodeType == Node.ELEMENT_NODE:
8c1d40768df7 gedit formatter/converter: fix links/transclusion (suppressing default alt texts needs more work)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2852
diff changeset
545 name = node.localName
8c1d40768df7 gedit formatter/converter: fix links/transclusion (suppressing default alt texts needs more work)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2852
diff changeset
546 if name == 'img':
8c1d40768df7 gedit formatter/converter: fix links/transclusion (suppressing default alt texts needs more work)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2852
diff changeset
547 markup = self._process_img(node) # XXX problem: markup containts auto-generated alt text with link target
8c1d40768df7 gedit formatter/converter: fix links/transclusion (suppressing default alt texts needs more work)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2852
diff changeset
548 break
8c1d40768df7 gedit formatter/converter: fix links/transclusion (suppressing default alt texts needs more work)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2852
diff changeset
549 elif name == 'object':
8c1d40768df7 gedit formatter/converter: fix links/transclusion (suppressing default alt texts needs more work)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2852
diff changeset
550 markup = self._process_object(node)
8c1d40768df7 gedit formatter/converter: fix links/transclusion (suppressing default alt texts needs more work)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2852
diff changeset
551 break
8c1d40768df7 gedit formatter/converter: fix links/transclusion (suppressing default alt texts needs more work)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2852
diff changeset
552 return markup
8c1d40768df7 gedit formatter/converter: fix links/transclusion (suppressing default alt texts needs more work)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2852
diff changeset
553
428
f4d09019cbb8 fixed MoinMoinBugs/ProcessInlineDontSupportUlElement, some converter code cleanup
Thomas Waldmann <tw@waldmann-edv.de>
parents: 407
diff changeset
554 def process_page(self, node):
f4d09019cbb8 fixed MoinMoinBugs/ProcessInlineDontSupportUlElement, some converter code cleanup
Thomas Waldmann <tw@waldmann-edv.de>
parents: 407
diff changeset
555 for i in node.childNodes:
f4d09019cbb8 fixed MoinMoinBugs/ProcessInlineDontSupportUlElement, some converter code cleanup
Thomas Waldmann <tw@waldmann-edv.de>
parents: 407
diff changeset
556 if i.nodeType == Node.ELEMENT_NODE:
f4d09019cbb8 fixed MoinMoinBugs/ProcessInlineDontSupportUlElement, some converter code cleanup
Thomas Waldmann <tw@waldmann-edv.de>
parents: 407
diff changeset
557 self.visit_element(i)
f4d09019cbb8 fixed MoinMoinBugs/ProcessInlineDontSupportUlElement, some converter code cleanup
Thomas Waldmann <tw@waldmann-edv.de>
parents: 407
diff changeset
558 elif i.nodeType == Node.TEXT_NODE: # if this is missing, all std text under a headline is dropped!
f4d09019cbb8 fixed MoinMoinBugs/ProcessInlineDontSupportUlElement, some converter code cleanup
Thomas Waldmann <tw@waldmann-edv.de>
parents: 407
diff changeset
559 txt = i.data.strip() # IMPORTANT: don't leave this unstripped or there will be wrong blanks
f4d09019cbb8 fixed MoinMoinBugs/ProcessInlineDontSupportUlElement, some converter code cleanup
Thomas Waldmann <tw@waldmann-edv.de>
parents: 407
diff changeset
560 if txt:
f4d09019cbb8 fixed MoinMoinBugs/ProcessInlineDontSupportUlElement, some converter code cleanup
Thomas Waldmann <tw@waldmann-edv.de>
parents: 407
diff changeset
561 self.text.append(txt)
f4d09019cbb8 fixed MoinMoinBugs/ProcessInlineDontSupportUlElement, some converter code cleanup
Thomas Waldmann <tw@waldmann-edv.de>
parents: 407
diff changeset
562 #we use <pre class="comment"> now, so this is currently unused:
f4d09019cbb8 fixed MoinMoinBugs/ProcessInlineDontSupportUlElement, some converter code cleanup
Thomas Waldmann <tw@waldmann-edv.de>
parents: 407
diff changeset
563 #elif i.nodeType == Node.COMMENT_NODE:
f4d09019cbb8 fixed MoinMoinBugs/ProcessInlineDontSupportUlElement, some converter code cleanup
Thomas Waldmann <tw@waldmann-edv.de>
parents: 407
diff changeset
564 # self.text.append(i.data)
f4d09019cbb8 fixed MoinMoinBugs/ProcessInlineDontSupportUlElement, some converter code cleanup
Thomas Waldmann <tw@waldmann-edv.de>
parents: 407
diff changeset
565 # self.text.append("\n")
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
566
428
f4d09019cbb8 fixed MoinMoinBugs/ProcessInlineDontSupportUlElement, some converter code cleanup
Thomas Waldmann <tw@waldmann-edv.de>
parents: 407
diff changeset
567 def process_br(self, node):
2847
dc9048024d49 text_html_text_moin_wiki: reverted changeset 2840
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 2840
diff changeset
568 self.text.append(self.new_line) # without this, std multi-line text below some heading misses a whitespace
dc9048024d49 text_html_text_moin_wiki: reverted changeset 2840
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 2840
diff changeset
569 # when it gets merged to float text, like word word wordword word word
564
a7f8bfd10322 gui converter: use (soft) new_line object more, strip trailing ws
Thomas Waldmann <tw@waldmann-edv.de>
parents: 563
diff changeset
570
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
571 def process_heading(self, node):
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
572 text = self.node_list_text_only(node.childNodes).strip()
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
573 if text:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
574 depth = int(node.localName[1]) - 1
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
575 hstr = "=" * depth
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
576 self.text.append(self.new_line)
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
577 self.text.append("%s %s %s" % (hstr, text.replace("\n", " "), hstr))
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
578 self.text.append(self.new_line)
999
97ce857bdebf whitespace-only cleanup and minor style changes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 878
diff changeset
579
428
f4d09019cbb8 fixed MoinMoinBugs/ProcessInlineDontSupportUlElement, some converter code cleanup
Thomas Waldmann <tw@waldmann-edv.de>
parents: 407
diff changeset
580 process_h1 = process_heading
f4d09019cbb8 fixed MoinMoinBugs/ProcessInlineDontSupportUlElement, some converter code cleanup
Thomas Waldmann <tw@waldmann-edv.de>
parents: 407
diff changeset
581 process_h2 = process_heading
f4d09019cbb8 fixed MoinMoinBugs/ProcessInlineDontSupportUlElement, some converter code cleanup
Thomas Waldmann <tw@waldmann-edv.de>
parents: 407
diff changeset
582 process_h3 = process_heading
f4d09019cbb8 fixed MoinMoinBugs/ProcessInlineDontSupportUlElement, some converter code cleanup
Thomas Waldmann <tw@waldmann-edv.de>
parents: 407
diff changeset
583 process_h4 = process_heading
f4d09019cbb8 fixed MoinMoinBugs/ProcessInlineDontSupportUlElement, some converter code cleanup
Thomas Waldmann <tw@waldmann-edv.de>
parents: 407
diff changeset
584 process_h5 = process_heading
f4d09019cbb8 fixed MoinMoinBugs/ProcessInlineDontSupportUlElement, some converter code cleanup
Thomas Waldmann <tw@waldmann-edv.de>
parents: 407
diff changeset
585 process_h6 = process_heading
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
586
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
587 def _get_list_item_markup(self, list, listitem):
407
bea43f99cc27 star-merged moin--refactor--1.5 (formatter, parser, converter fixes, see docs/CHANGES.refactor)
Thomas Waldmann <tw@waldmann-edv.de>
parents: 294
diff changeset
588 before = ""
bea43f99cc27 star-merged moin--refactor--1.5 (formatter, parser, converter fixes, see docs/CHANGES.refactor)
Thomas Waldmann <tw@waldmann-edv.de>
parents: 294
diff changeset
589 #indent = str(self.depth) * self.depth # nice for debugging :)
bea43f99cc27 star-merged moin--refactor--1.5 (formatter, parser, converter fixes, see docs/CHANGES.refactor)
Thomas Waldmann <tw@waldmann-edv.de>
parents: 294
diff changeset
590 indent = " " * self.depth
bea43f99cc27 star-merged moin--refactor--1.5 (formatter, parser, converter fixes, see docs/CHANGES.refactor)
Thomas Waldmann <tw@waldmann-edv.de>
parents: 294
diff changeset
591 markup = ""
bea43f99cc27 star-merged moin--refactor--1.5 (formatter, parser, converter fixes, see docs/CHANGES.refactor)
Thomas Waldmann <tw@waldmann-edv.de>
parents: 294
diff changeset
592 name = list.localName
bea43f99cc27 star-merged moin--refactor--1.5 (formatter, parser, converter fixes, see docs/CHANGES.refactor)
Thomas Waldmann <tw@waldmann-edv.de>
parents: 294
diff changeset
593 if name == 'ol':
bea43f99cc27 star-merged moin--refactor--1.5 (formatter, parser, converter fixes, see docs/CHANGES.refactor)
Thomas Waldmann <tw@waldmann-edv.de>
parents: 294
diff changeset
594 class_ = listitem.getAttribute("class")
bea43f99cc27 star-merged moin--refactor--1.5 (formatter, parser, converter fixes, see docs/CHANGES.refactor)
Thomas Waldmann <tw@waldmann-edv.de>
parents: 294
diff changeset
595 if class_ == "gap":
1736
6e4acd9904d7 fix wrong merging of significant newline chars (fixes wrong removal of empty lines in pre sections, fixes wrong merging of tables separates by empty line, fixes wrong removal of li/ol gaps, add empty line after lists)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1725
diff changeset
596 before = self.new_line_dont_remove
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
597 if list.hasAttribute("type"):
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
598 type = list.getAttribute("type")
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
599 else:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
600 type = "1"
407
bea43f99cc27 star-merged moin--refactor--1.5 (formatter, parser, converter fixes, see docs/CHANGES.refactor)
Thomas Waldmann <tw@waldmann-edv.de>
parents: 294
diff changeset
601 markup = "%s. " % type
bea43f99cc27 star-merged moin--refactor--1.5 (formatter, parser, converter fixes, see docs/CHANGES.refactor)
Thomas Waldmann <tw@waldmann-edv.de>
parents: 294
diff changeset
602 elif name == 'ul':
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
603 class_ = listitem.getAttribute("class")
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
604 if class_ == "gap":
1736
6e4acd9904d7 fix wrong merging of significant newline chars (fixes wrong removal of empty lines in pre sections, fixes wrong merging of tables separates by empty line, fixes wrong removal of li/ol gaps, add empty line after lists)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1725
diff changeset
605 before = self.new_line_dont_remove
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
606 style = listitem.getAttribute("style")
1005
e1e1885deec1 whitespace-only cleanup, fix regex by using raw string
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 999
diff changeset
607 if re.match(ur"list-style-type:\s*none", style, re.I):
4010
fdfed78ebd72 replace functional expression with interation
Byeongweon [tasyblue@gmail.com]
parents: 4009
diff changeset
608 markup = ". "
fdfed78ebd72 replace functional expression with interation
Byeongweon [tasyblue@gmail.com]
parents: 4009
diff changeset
609 # set markup with white space when list element containes table
fdfed78ebd72 replace functional expression with interation
Byeongweon [tasyblue@gmail.com]
parents: 4009
diff changeset
610 for i in listitem.childNodes:
fdfed78ebd72 replace functional expression with interation
Byeongweon [tasyblue@gmail.com]
parents: 4009
diff changeset
611 if i.nodeType == Node.ELEMENT_NODE:
fdfed78ebd72 replace functional expression with interation
Byeongweon [tasyblue@gmail.com]
parents: 4009
diff changeset
612 if i.localName == 'table':
fdfed78ebd72 replace functional expression with interation
Byeongweon [tasyblue@gmail.com]
parents: 4009
diff changeset
613 markup = " "
4011
42526183b82b fix normal list notation didn't work problem
Byeongweon [tasyblue@gmail.com]
parents: 4010
diff changeset
614 else:
42526183b82b fix normal list notation didn't work problem
Byeongweon [tasyblue@gmail.com]
parents: 4010
diff changeset
615 markup = "* "
407
bea43f99cc27 star-merged moin--refactor--1.5 (formatter, parser, converter fixes, see docs/CHANGES.refactor)
Thomas Waldmann <tw@waldmann-edv.de>
parents: 294
diff changeset
616 elif name == 'dl':
bea43f99cc27 star-merged moin--refactor--1.5 (formatter, parser, converter fixes, see docs/CHANGES.refactor)
Thomas Waldmann <tw@waldmann-edv.de>
parents: 294
diff changeset
617 markup = ":: "
bea43f99cc27 star-merged moin--refactor--1.5 (formatter, parser, converter fixes, see docs/CHANGES.refactor)
Thomas Waldmann <tw@waldmann-edv.de>
parents: 294
diff changeset
618 else:
bea43f99cc27 star-merged moin--refactor--1.5 (formatter, parser, converter fixes, see docs/CHANGES.refactor)
Thomas Waldmann <tw@waldmann-edv.de>
parents: 294
diff changeset
619 raise ConvertError("Illegal list type %s" % name)
bea43f99cc27 star-merged moin--refactor--1.5 (formatter, parser, converter fixes, see docs/CHANGES.refactor)
Thomas Waldmann <tw@waldmann-edv.de>
parents: 294
diff changeset
620 return before, indent, markup
bea43f99cc27 star-merged moin--refactor--1.5 (formatter, parser, converter fixes, see docs/CHANGES.refactor)
Thomas Waldmann <tw@waldmann-edv.de>
parents: 294
diff changeset
621
bea43f99cc27 star-merged moin--refactor--1.5 (formatter, parser, converter fixes, see docs/CHANGES.refactor)
Thomas Waldmann <tw@waldmann-edv.de>
parents: 294
diff changeset
622 def process_dl(self, node):
bea43f99cc27 star-merged moin--refactor--1.5 (formatter, parser, converter fixes, see docs/CHANGES.refactor)
Thomas Waldmann <tw@waldmann-edv.de>
parents: 294
diff changeset
623 self.depth += 1
bea43f99cc27 star-merged moin--refactor--1.5 (formatter, parser, converter fixes, see docs/CHANGES.refactor)
Thomas Waldmann <tw@waldmann-edv.de>
parents: 294
diff changeset
624 markup = ":: " # can there be a dl dd without dt?
bea43f99cc27 star-merged moin--refactor--1.5 (formatter, parser, converter fixes, see docs/CHANGES.refactor)
Thomas Waldmann <tw@waldmann-edv.de>
parents: 294
diff changeset
625 for i in node.childNodes:
bea43f99cc27 star-merged moin--refactor--1.5 (formatter, parser, converter fixes, see docs/CHANGES.refactor)
Thomas Waldmann <tw@waldmann-edv.de>
parents: 294
diff changeset
626 if i.nodeType == Node.ELEMENT_NODE:
bea43f99cc27 star-merged moin--refactor--1.5 (formatter, parser, converter fixes, see docs/CHANGES.refactor)
Thomas Waldmann <tw@waldmann-edv.de>
parents: 294
diff changeset
627 name = i.localName
bea43f99cc27 star-merged moin--refactor--1.5 (formatter, parser, converter fixes, see docs/CHANGES.refactor)
Thomas Waldmann <tw@waldmann-edv.de>
parents: 294
diff changeset
628 if name == 'dt':
bea43f99cc27 star-merged moin--refactor--1.5 (formatter, parser, converter fixes, see docs/CHANGES.refactor)
Thomas Waldmann <tw@waldmann-edv.de>
parents: 294
diff changeset
629 before, indent, markup = self._get_list_item_markup(node, i)
1736
6e4acd9904d7 fix wrong merging of significant newline chars (fixes wrong removal of empty lines in pre sections, fixes wrong merging of tables separates by empty line, fixes wrong removal of li/ol gaps, add empty line after lists)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1725
diff changeset
630 self.text.extend([before, indent])
407
bea43f99cc27 star-merged moin--refactor--1.5 (formatter, parser, converter fixes, see docs/CHANGES.refactor)
Thomas Waldmann <tw@waldmann-edv.de>
parents: 294
diff changeset
631 text = self.node_list_text_only(i.childNodes)
bea43f99cc27 star-merged moin--refactor--1.5 (formatter, parser, converter fixes, see docs/CHANGES.refactor)
Thomas Waldmann <tw@waldmann-edv.de>
parents: 294
diff changeset
632 self.text.append(text.replace("\n", " "))
bea43f99cc27 star-merged moin--refactor--1.5 (formatter, parser, converter fixes, see docs/CHANGES.refactor)
Thomas Waldmann <tw@waldmann-edv.de>
parents: 294
diff changeset
633 elif name == 'dd':
bea43f99cc27 star-merged moin--refactor--1.5 (formatter, parser, converter fixes, see docs/CHANGES.refactor)
Thomas Waldmann <tw@waldmann-edv.de>
parents: 294
diff changeset
634 self.text.append(markup)
878
d825de2173d5 add comment to GUI converter, add missing packages to setup.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 862
diff changeset
635 self.process_list_item(i, indent) # XXX no dt -> indent is undefined!!!
407
bea43f99cc27 star-merged moin--refactor--1.5 (formatter, parser, converter fixes, see docs/CHANGES.refactor)
Thomas Waldmann <tw@waldmann-edv.de>
parents: 294
diff changeset
636 else:
bea43f99cc27 star-merged moin--refactor--1.5 (formatter, parser, converter fixes, see docs/CHANGES.refactor)
Thomas Waldmann <tw@waldmann-edv.de>
parents: 294
diff changeset
637 raise ConvertError("Illegal list element %s" % i.localName)
bea43f99cc27 star-merged moin--refactor--1.5 (formatter, parser, converter fixes, see docs/CHANGES.refactor)
Thomas Waldmann <tw@waldmann-edv.de>
parents: 294
diff changeset
638 self.depth -= 1
bea43f99cc27 star-merged moin--refactor--1.5 (formatter, parser, converter fixes, see docs/CHANGES.refactor)
Thomas Waldmann <tw@waldmann-edv.de>
parents: 294
diff changeset
639 if self.depth == 0:
1736
6e4acd9904d7 fix wrong merging of significant newline chars (fixes wrong removal of empty lines in pre sections, fixes wrong merging of tables separates by empty line, fixes wrong removal of li/ol gaps, add empty line after lists)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1725
diff changeset
640 self.text.append(self.new_line_dont_remove)
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
641
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
642 def process_list(self, node):
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
643 self.depth += 1
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
644 for i in node.childNodes:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
645 if i.nodeType == Node.ELEMENT_NODE:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
646 name = i.localName
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
647 if name == 'li':
407
bea43f99cc27 star-merged moin--refactor--1.5 (formatter, parser, converter fixes, see docs/CHANGES.refactor)
Thomas Waldmann <tw@waldmann-edv.de>
parents: 294
diff changeset
648 before, indent, markup = self._get_list_item_markup(node, i)
1736
6e4acd9904d7 fix wrong merging of significant newline chars (fixes wrong removal of empty lines in pre sections, fixes wrong merging of tables separates by empty line, fixes wrong removal of li/ol gaps, add empty line after lists)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1725
diff changeset
649 self.text.extend([before, indent, markup])
407
bea43f99cc27 star-merged moin--refactor--1.5 (formatter, parser, converter fixes, see docs/CHANGES.refactor)
Thomas Waldmann <tw@waldmann-edv.de>
parents: 294
diff changeset
650 self.process_list_item(i, indent)
2286
01f05e74aa9c Big PEP8 and whitespace cleanup
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1918
diff changeset
651 elif name in ('ol', 'ul', ):
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
652 self.process_list(i)
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
653 elif name == 'dl':
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
654 self.process_dl(i)
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
655 else:
48
8a37de5a6b79 fixed broken tests package, moved ConvertError to convert module
Nir Soffer <nirs@freeshell.org>
parents: 37
diff changeset
656 raise ConvertError("Illegal list element %s" % i.localName)
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
657 self.depth -= 1
407
bea43f99cc27 star-merged moin--refactor--1.5 (formatter, parser, converter fixes, see docs/CHANGES.refactor)
Thomas Waldmann <tw@waldmann-edv.de>
parents: 294
diff changeset
658 if self.depth == 0:
1736
6e4acd9904d7 fix wrong merging of significant newline chars (fixes wrong removal of empty lines in pre sections, fixes wrong merging of tables separates by empty line, fixes wrong removal of li/ol gaps, add empty line after lists)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1725
diff changeset
659 self.text.append(self.new_line_dont_remove)
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
660
428
f4d09019cbb8 fixed MoinMoinBugs/ProcessInlineDontSupportUlElement, some converter code cleanup
Thomas Waldmann <tw@waldmann-edv.de>
parents: 407
diff changeset
661 process_ul = process_list
f4d09019cbb8 fixed MoinMoinBugs/ProcessInlineDontSupportUlElement, some converter code cleanup
Thomas Waldmann <tw@waldmann-edv.de>
parents: 407
diff changeset
662 process_ol = process_list
f4d09019cbb8 fixed MoinMoinBugs/ProcessInlineDontSupportUlElement, some converter code cleanup
Thomas Waldmann <tw@waldmann-edv.de>
parents: 407
diff changeset
663
560
b4eedd2147ff gui converter: fix processing of complex list elements
Thomas Waldmann <tw@waldmann-edv.de>
parents: 559
diff changeset
664 def empty_paragraph_queue(self, nodelist, indent, need_indent):
b4eedd2147ff gui converter: fix processing of complex list elements
Thomas Waldmann <tw@waldmann-edv.de>
parents: 559
diff changeset
665 if need_indent:
b4eedd2147ff gui converter: fix processing of complex list elements
Thomas Waldmann <tw@waldmann-edv.de>
parents: 559
diff changeset
666 self.text.append(indent)
b4eedd2147ff gui converter: fix processing of complex list elements
Thomas Waldmann <tw@waldmann-edv.de>
parents: 559
diff changeset
667 for i in nodelist:
b4eedd2147ff gui converter: fix processing of complex list elements
Thomas Waldmann <tw@waldmann-edv.de>
parents: 559
diff changeset
668 if i.nodeType == Node.ELEMENT_NODE:
3993
e0301e5bf019 fix gui editor line break in list problem MoinMoinBugs/GuiEditorLineBreakInLists
Byeongweon [tasyblue@gmail.com]
parents: 3992
diff changeset
669 if i.localName == 'br':
e0301e5bf019 fix gui editor line break in list problem MoinMoinBugs/GuiEditorLineBreakInLists
Byeongweon [tasyblue@gmail.com]
parents: 3992
diff changeset
670 self.text.append('<<BR>>')
e0301e5bf019 fix gui editor line break in list problem MoinMoinBugs/GuiEditorLineBreakInLists
Byeongweon [tasyblue@gmail.com]
parents: 3992
diff changeset
671 else:
e0301e5bf019 fix gui editor line break in list problem MoinMoinBugs/GuiEditorLineBreakInLists
Byeongweon [tasyblue@gmail.com]
parents: 3992
diff changeset
672 self.process_inline(i)
560
b4eedd2147ff gui converter: fix processing of complex list elements
Thomas Waldmann <tw@waldmann-edv.de>
parents: 559
diff changeset
673 elif i.nodeType == Node.TEXT_NODE:
b4eedd2147ff gui converter: fix processing of complex list elements
Thomas Waldmann <tw@waldmann-edv.de>
parents: 559
diff changeset
674 self.text.append(i.data.strip('\n').replace('\n', ' '))
564
a7f8bfd10322 gui converter: use (soft) new_line object more, strip trailing ws
Thomas Waldmann <tw@waldmann-edv.de>
parents: 563
diff changeset
675 self.text.append(self.new_line)
560
b4eedd2147ff gui converter: fix processing of complex list elements
Thomas Waldmann <tw@waldmann-edv.de>
parents: 559
diff changeset
676 del nodelist[:]
b4eedd2147ff gui converter: fix processing of complex list elements
Thomas Waldmann <tw@waldmann-edv.de>
parents: 559
diff changeset
677
407
bea43f99cc27 star-merged moin--refactor--1.5 (formatter, parser, converter fixes, see docs/CHANGES.refactor)
Thomas Waldmann <tw@waldmann-edv.de>
parents: 294
diff changeset
678 def process_list_item(self, node, indent):
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
679 found = False
560
b4eedd2147ff gui converter: fix processing of complex list elements
Thomas Waldmann <tw@waldmann-edv.de>
parents: 559
diff changeset
680 need_indent = False
b4eedd2147ff gui converter: fix processing of complex list elements
Thomas Waldmann <tw@waldmann-edv.de>
parents: 559
diff changeset
681 pending = []
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
682 for i in node.childNodes:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
683 name = i.localName
560
b4eedd2147ff gui converter: fix processing of complex list elements
Thomas Waldmann <tw@waldmann-edv.de>
parents: 559
diff changeset
684
2286
01f05e74aa9c Big PEP8 and whitespace cleanup
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1918
diff changeset
685 if name in ('p', 'pre', 'ol', 'ul', 'dl', 'table', ) and pending:
560
b4eedd2147ff gui converter: fix processing of complex list elements
Thomas Waldmann <tw@waldmann-edv.de>
parents: 559
diff changeset
686 self.empty_paragraph_queue(pending, indent, need_indent)
b4eedd2147ff gui converter: fix processing of complex list elements
Thomas Waldmann <tw@waldmann-edv.de>
parents: 559
diff changeset
687 need_indent = True
999
97ce857bdebf whitespace-only cleanup and minor style changes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 878
diff changeset
688
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
689 if name == 'p':
560
b4eedd2147ff gui converter: fix processing of complex list elements
Thomas Waldmann <tw@waldmann-edv.de>
parents: 559
diff changeset
690 if need_indent:
407
bea43f99cc27 star-merged moin--refactor--1.5 (formatter, parser, converter fixes, see docs/CHANGES.refactor)
Thomas Waldmann <tw@waldmann-edv.de>
parents: 294
diff changeset
691 self.text.append(indent)
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
692 self.process_paragraph_item(i)
564
a7f8bfd10322 gui converter: use (soft) new_line object more, strip trailing ws
Thomas Waldmann <tw@waldmann-edv.de>
parents: 563
diff changeset
693 self.text.append(self.new_line)
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
694 found = True
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
695 elif name == 'pre':
560
b4eedd2147ff gui converter: fix processing of complex list elements
Thomas Waldmann <tw@waldmann-edv.de>
parents: 559
diff changeset
696 if need_indent:
407
bea43f99cc27 star-merged moin--refactor--1.5 (formatter, parser, converter fixes, see docs/CHANGES.refactor)
Thomas Waldmann <tw@waldmann-edv.de>
parents: 294
diff changeset
697 self.text.append(indent)
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
698 self.process_preformatted_item(i)
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
699 found = True
2286
01f05e74aa9c Big PEP8 and whitespace cleanup
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1918
diff changeset
700 elif name in ('ol', 'ul', ):
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
701 self.process_list(i)
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
702 found = True
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
703 elif name == 'dl':
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
704 self.process_dl(i)
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
705 found = True
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
706 elif name == 'table':
560
b4eedd2147ff gui converter: fix processing of complex list elements
Thomas Waldmann <tw@waldmann-edv.de>
parents: 559
diff changeset
707 if need_indent:
407
bea43f99cc27 star-merged moin--refactor--1.5 (formatter, parser, converter fixes, see docs/CHANGES.refactor)
Thomas Waldmann <tw@waldmann-edv.de>
parents: 294
diff changeset
708 self.text.append(indent)
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
709 self.process_table(i)
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
710 found = True
3993
e0301e5bf019 fix gui editor line break in list problem MoinMoinBugs/GuiEditorLineBreakInLists
Byeongweon [tasyblue@gmail.com]
parents: 3992
diff changeset
711 elif name == 'br':
e0301e5bf019 fix gui editor line break in list problem MoinMoinBugs/GuiEditorLineBreakInLists
Byeongweon [tasyblue@gmail.com]
parents: 3992
diff changeset
712 pending.append(i)
560
b4eedd2147ff gui converter: fix processing of complex list elements
Thomas Waldmann <tw@waldmann-edv.de>
parents: 559
diff changeset
713 else:
b4eedd2147ff gui converter: fix processing of complex list elements
Thomas Waldmann <tw@waldmann-edv.de>
parents: 559
diff changeset
714 pending.append(i)
b4eedd2147ff gui converter: fix processing of complex list elements
Thomas Waldmann <tw@waldmann-edv.de>
parents: 559
diff changeset
715
b4eedd2147ff gui converter: fix processing of complex list elements
Thomas Waldmann <tw@waldmann-edv.de>
parents: 559
diff changeset
716 if found:
b4eedd2147ff gui converter: fix processing of complex list elements
Thomas Waldmann <tw@waldmann-edv.de>
parents: 559
diff changeset
717 need_indent = True
b4eedd2147ff gui converter: fix processing of complex list elements
Thomas Waldmann <tw@waldmann-edv.de>
parents: 559
diff changeset
718
b4eedd2147ff gui converter: fix processing of complex list elements
Thomas Waldmann <tw@waldmann-edv.de>
parents: 559
diff changeset
719 if pending:
b4eedd2147ff gui converter: fix processing of complex list elements
Thomas Waldmann <tw@waldmann-edv.de>
parents: 559
diff changeset
720 self.empty_paragraph_queue(pending, indent, need_indent)
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
721
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
722 def process_blockquote(self, node):
407
bea43f99cc27 star-merged moin--refactor--1.5 (formatter, parser, converter fixes, see docs/CHANGES.refactor)
Thomas Waldmann <tw@waldmann-edv.de>
parents: 294
diff changeset
723 # XXX this does not really work. e.g.:
bea43f99cc27 star-merged moin--refactor--1.5 (formatter, parser, converter fixes, see docs/CHANGES.refactor)
Thomas Waldmann <tw@waldmann-edv.de>
parents: 294
diff changeset
724 # <bq>aaaaaa
bea43f99cc27 star-merged moin--refactor--1.5 (formatter, parser, converter fixes, see docs/CHANGES.refactor)
Thomas Waldmann <tw@waldmann-edv.de>
parents: 294
diff changeset
725 # <hr---------->
bea43f99cc27 star-merged moin--refactor--1.5 (formatter, parser, converter fixes, see docs/CHANGES.refactor)
Thomas Waldmann <tw@waldmann-edv.de>
parents: 294
diff changeset
726 # <bq>bbbbbb
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
727 self.depth += 1
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
728 for i in node.childNodes:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
729 if i.nodeType == Node.ELEMENT_NODE:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
730 name = i.localName
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
731 if name == 'p':
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
732 self.text.append(self.new_line)
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
733 self.text.append(" " * self.depth)
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
734 self.process_p(i)
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
735 elif name == 'pre':
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
736 self.text.append(self.new_line)
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
737 self.text.append(" " * self.depth)
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
738 self.process_pre(i)
2286
01f05e74aa9c Big PEP8 and whitespace cleanup
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1918
diff changeset
739 elif name in ('h1', 'h2', 'h3', 'h4', 'h5', 'h6', ):
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
740 self.process_heading(i)
2286
01f05e74aa9c Big PEP8 and whitespace cleanup
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1918
diff changeset
741 elif name in ('ol', 'ul', ):
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
742 self.process_list(i)
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
743 elif name == 'dl':
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
744 self.process_dl(i)
1757
d4f3fc3f0afc gui converter: don't crash on col/colgroup/meta/a (ported from 1.5-788)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1740
diff changeset
745 elif name == 'a':
d4f3fc3f0afc gui converter: don't crash on col/colgroup/meta/a (ported from 1.5-788)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1740
diff changeset
746 self.process_a(i)
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
747 elif name == 'img':
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
748 self.process_img(i)
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
749 elif name == 'div':
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
750 self.visit_node_list_element_only(i.childNodes)
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
751 elif name == 'blockquote':
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
752 self.process_blockquote(i)
407
bea43f99cc27 star-merged moin--refactor--1.5 (formatter, parser, converter fixes, see docs/CHANGES.refactor)
Thomas Waldmann <tw@waldmann-edv.de>
parents: 294
diff changeset
753 elif name == 'hr':
bea43f99cc27 star-merged moin--refactor--1.5 (formatter, parser, converter fixes, see docs/CHANGES.refactor)
Thomas Waldmann <tw@waldmann-edv.de>
parents: 294
diff changeset
754 self.process_hr(i)
bea43f99cc27 star-merged moin--refactor--1.5 (formatter, parser, converter fixes, see docs/CHANGES.refactor)
Thomas Waldmann <tw@waldmann-edv.de>
parents: 294
diff changeset
755 elif name == 'br':
19
6772e845059d fix for gecko paste link brokenness, src cosmetics
Thomas Waldmann <tw@waldmann-edv.de>
parents: 10
diff changeset
756 self.process_br(i)
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
757 else:
48
8a37de5a6b79 fixed broken tests package, moved ConvertError to convert module
Nir Soffer <nirs@freeshell.org>
parents: 37
diff changeset
758 raise ConvertError("process_blockquote: Don't support %s element" % name)
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
759 self.depth -= 1
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
760
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
761 def process_inline(self, node):
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
762 if node.nodeType == Node.TEXT_NODE:
999
97ce857bdebf whitespace-only cleanup and minor style changes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 878
diff changeset
763 self.text.append(node.data.strip('\n').replace('\n', ' '))
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
764 return
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
765
1700
c54be3afb830 gui editor converter: indenting fixes, code simplification
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1649
diff changeset
766 # do we need to check for Node.ELEMENT_NODE and return (do nothing)?
276
9b21b7907167 this should fix MoinMoinBugs/GuiEditorTypeErrorWhenSaving
Thomas Waldmann <tw@waldmann-edv.de>
parents: 275
diff changeset
767 name = node.localName # can be None for DOM Comment nodes
9b21b7907167 this should fix MoinMoinBugs/GuiEditorTypeErrorWhenSaving
Thomas Waldmann <tw@waldmann-edv.de>
parents: 275
diff changeset
768 if name is None:
9b21b7907167 this should fix MoinMoinBugs/GuiEditorTypeErrorWhenSaving
Thomas Waldmann <tw@waldmann-edv.de>
parents: 275
diff changeset
769 return
428
f4d09019cbb8 fixed MoinMoinBugs/ProcessInlineDontSupportUlElement, some converter code cleanup
Thomas Waldmann <tw@waldmann-edv.de>
parents: 407
diff changeset
770
2850
8a5c932ad8ab text_html_text_moin_wiki: added unsupported tags to process_inline
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 2849
diff changeset
771 # unsupported tags
8a5c932ad8ab text_html_text_moin_wiki: added unsupported tags to process_inline
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 2849
diff changeset
772 if name in (u'title', u'meta', u'style'):
8a5c932ad8ab text_html_text_moin_wiki: added unsupported tags to process_inline
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 2849
diff changeset
773 return
8a5c932ad8ab text_html_text_moin_wiki: added unsupported tags to process_inline
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 2849
diff changeset
774
2286
01f05e74aa9c Big PEP8 and whitespace cleanup
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1918
diff changeset
775 if name in ('h1', 'h2', 'h3', 'h4', 'h5', 'h6', ): # headers are not allowed here (e.g. inside a ul li),
428
f4d09019cbb8 fixed MoinMoinBugs/ProcessInlineDontSupportUlElement, some converter code cleanup
Thomas Waldmann <tw@waldmann-edv.de>
parents: 407
diff changeset
776 text = self.node_list_text_only(node.childNodes).strip() # but can be inserted via the editor
f4d09019cbb8 fixed MoinMoinBugs/ProcessInlineDontSupportUlElement, some converter code cleanup
Thomas Waldmann <tw@waldmann-edv.de>
parents: 407
diff changeset
777 self.text.append(text) # so we just drop the header markup and keep the text
f4d09019cbb8 fixed MoinMoinBugs/ProcessInlineDontSupportUlElement, some converter code cleanup
Thomas Waldmann <tw@waldmann-edv.de>
parents: 407
diff changeset
778 return
999
97ce857bdebf whitespace-only cleanup and minor style changes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 878
diff changeset
779
97ce857bdebf whitespace-only cleanup and minor style changes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 878
diff changeset
780 func = getattr(self, "process_%s" % name, None)
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
781 if func:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
782 func(node)
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
783 return
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
784
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
785 command_close = None
2286
01f05e74aa9c Big PEP8 and whitespace cleanup
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1918
diff changeset
786 if name in ('em', 'i', ):
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
787 command = "''"
2286
01f05e74aa9c Big PEP8 and whitespace cleanup
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1918
diff changeset
788 elif name in ('strong', 'b', ):
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
789 command = "'''"
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
790 elif name == 'u':
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
791 command = "__"
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
792 elif name == 'big':
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
793 command = "~+"
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
794 command_close = "+~"
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
795 elif name == 'small':
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
796 command = "~-"
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
797 command_close = "-~"
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
798 elif name == 'strike':
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
799 command = "--("
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
800 command_close = ")--"
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
801 elif name == 'sub':
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
802 command = ",,"
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
803 elif name == 'sup':
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
804 command = "^"
1757
d4f3fc3f0afc gui converter: don't crash on col/colgroup/meta/a (ported from 1.5-788)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1740
diff changeset
805 elif name in ('font', 'meta', ):
d4f3fc3f0afc gui converter: don't crash on col/colgroup/meta/a (ported from 1.5-788)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1740
diff changeset
806 command = "" # just throw away unsupported elements
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
807 else:
48
8a37de5a6b79 fixed broken tests package, moved ConvertError to convert module
Nir Soffer <nirs@freeshell.org>
parents: 37
diff changeset
808 raise ConvertError("process_inline: Don't support %s element" % name)
999
97ce857bdebf whitespace-only cleanup and minor style changes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 878
diff changeset
809
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
810 self.text.append(command)
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
811 for i in node.childNodes:
2908
0bc6871c65de text_html_text_moin_wiki.process_inline: linebreaks as <<BR>> and not \n
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 2902
diff changeset
812 # lonly childnodes checked if they are only 'br'
0bc6871c65de text_html_text_moin_wiki.process_inline: linebreaks as <<BR>> and not \n
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 2902
diff changeset
813 if command and len(node.childNodes) == 1:
0bc6871c65de text_html_text_moin_wiki.process_inline: linebreaks as <<BR>> and not \n
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 2902
diff changeset
814 # formatted br alone is not wanted (who wants a bold br?)
0bc6871c65de text_html_text_moin_wiki.process_inline: linebreaks as <<BR>> and not \n
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 2902
diff changeset
815 if i.localName != 'br':
0bc6871c65de text_html_text_moin_wiki.process_inline: linebreaks as <<BR>> and not \n
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 2902
diff changeset
816 self.process_inline(i)
0bc6871c65de text_html_text_moin_wiki.process_inline: linebreaks as <<BR>> and not \n
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 2902
diff changeset
817 else:
0bc6871c65de text_html_text_moin_wiki.process_inline: linebreaks as <<BR>> and not \n
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 2902
diff changeset
818 if i.localName == 'br':
0bc6871c65de text_html_text_moin_wiki.process_inline: linebreaks as <<BR>> and not \n
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 2902
diff changeset
819 # dont make a real \n because that breaks tables
0bc6871c65de text_html_text_moin_wiki.process_inline: linebreaks as <<BR>> and not \n
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 2902
diff changeset
820 self.text.append('<<BR>>')
0bc6871c65de text_html_text_moin_wiki.process_inline: linebreaks as <<BR>> and not \n
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 2902
diff changeset
821 else:
0bc6871c65de text_html_text_moin_wiki.process_inline: linebreaks as <<BR>> and not \n
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 2902
diff changeset
822 self.process_inline(i)
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
823 if command_close:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
824 command = command_close
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
825 self.text.append(command)
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
826
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
827 def process_span(self, node):
3992
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
828 # process span tag for firefox3
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
829 node_style = node.getAttribute("style")
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
830
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
831 is_strike = node.getAttribute("class") == "strike"
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
832 is_strike = is_strike or "line-through" in node_style
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
833 is_strong = "bold" in node_style
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
834 is_italic = "italic" in node_style
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
835 is_underline = "underline" in node_style
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
836 is_comment = node.getAttribute("class") == "comment"
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
837
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
838 # start tag
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
839 if is_comment:
3988
be43e3973baa fix gui editor remove inline comments problem
Byeongweon [tasyblue@gmail.com]
parents: 3984
diff changeset
840 self.text.append("/* ")
645
8da03e8daeb0 fix vanishing strike markup after gui editor usage (backport to 1.5)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 607
diff changeset
841 if is_strike:
3992
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
842 self.text.append("--(")
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
843 if is_strong:
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
844 self.text.append("'''")
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
845 if is_italic:
3975
d8771735a6db fix 'inline tags replaced by span tag with firefox rich text editor Midas issue'
Byeongweon [tasyblue@gmail.com]
parents: 3962
diff changeset
846 self.text.append("''")
3992
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
847 if is_underline:
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
848 self.text.append("__")
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
849
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
850 # body
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
851 for i in node.childNodes:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
852 self.process_inline(i)
3992
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
853
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
854 # end tag
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
855 if is_underline:
3975
d8771735a6db fix 'inline tags replaced by span tag with firefox rich text editor Midas issue'
Byeongweon [tasyblue@gmail.com]
parents: 3962
diff changeset
856 self.text.append("__")
3992
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
857 if is_italic:
3975
d8771735a6db fix 'inline tags replaced by span tag with firefox rich text editor Midas issue'
Byeongweon [tasyblue@gmail.com]
parents: 3962
diff changeset
858 self.text.append("''")
3992
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
859 if is_strong:
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
860 self.text.append("'''")
645
8da03e8daeb0 fix vanishing strike markup after gui editor usage (backport to 1.5)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 607
diff changeset
861 if is_strike:
3992
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
862 self.text.append(")--")
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
863 if is_comment:
3988
be43e3973baa fix gui editor remove inline comments problem
Byeongweon [tasyblue@gmail.com]
parents: 3984
diff changeset
864 self.text.append(" */")
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
865
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
866 def process_div(self, node):
4001
5bb18401738b fix MoinMoinBugs/GuiEditorIndentStyledText bug
Byeongweon [tasyblue@gmail.com]
parents: 3998
diff changeset
867 # process indent
5bb18401738b fix MoinMoinBugs/GuiEditorIndentStyledText bug
Byeongweon [tasyblue@gmail.com]
parents: 3998
diff changeset
868 self._process_indent(node)
5bb18401738b fix MoinMoinBugs/GuiEditorIndentStyledText bug
Byeongweon [tasyblue@gmail.com]
parents: 3998
diff changeset
869
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
870 # ignore div tags - just descend
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
871 for i in node.childNodes:
854
a71bcc0f27c3 fixed MoinMoinBugs:GuiEditorDeletesNewBulletText
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 834
diff changeset
872 self.visit(i)
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
873
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
874 def process_tt(self, node):
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
875 text = self.node_list_text_only(node.childNodes).replace("\n", " ")
1515
b3a47164c22a fix backticks vs. curly brackets confusion of gui converter (backport to 1.5)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1318
diff changeset
876 if node.getAttribute("class") == "backtick":
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
877 self.text.append("`%s`" % text)
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
878 else:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
879 self.text.append("{{{%s}}}" % text)
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
880
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
881 def process_hr(self, node):
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
882 if node.hasAttribute("class"):
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
883 class_ = node.getAttribute("class")
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
884 else:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
885 class_ = "hr0"
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
886 if class_.startswith("hr") and class_[2] in "123456":
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
887 length = int(class_[2]) + 4
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
888 else:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
889 length = 4
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
890 self.text.extend([self.new_line, "-" * length, self.new_line])
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
891
3992
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
892 def process_p(self, node):
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
893 # process indent
4001
5bb18401738b fix MoinMoinBugs/GuiEditorIndentStyledText bug
Byeongweon [tasyblue@gmail.com]
parents: 3998
diff changeset
894 self._process_indent(node)
5bb18401738b fix MoinMoinBugs/GuiEditorIndentStyledText bug
Byeongweon [tasyblue@gmail.com]
parents: 3998
diff changeset
895 self.process_paragraph_item(node)
5bb18401738b fix MoinMoinBugs/GuiEditorIndentStyledText bug
Byeongweon [tasyblue@gmail.com]
parents: 3998
diff changeset
896 self.text.append("\n\n") # do not use self.new_line here!
5bb18401738b fix MoinMoinBugs/GuiEditorIndentStyledText bug
Byeongweon [tasyblue@gmail.com]
parents: 3998
diff changeset
897
5bb18401738b fix MoinMoinBugs/GuiEditorIndentStyledText bug
Byeongweon [tasyblue@gmail.com]
parents: 3998
diff changeset
898 def _process_indent(self, node):
5bb18401738b fix MoinMoinBugs/GuiEditorIndentStyledText bug
Byeongweon [tasyblue@gmail.com]
parents: 3998
diff changeset
899 # process indent
3992
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
900 node_style = node.getAttribute("style")
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
901 match = re.match(r"margin-left:\s*(\d+)px", node_style)
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
902 if match:
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
903 left_margin = int(match.group(1))
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
904 indent_depth = int(left_margin / 40)
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
905 if indent_depth > 0:
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
906 self.text.append(' . ')
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
907
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
908 def process_paragraph_item(self, node):
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
909 for i in node.childNodes:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
910 if i.nodeType == Node.ELEMENT_NODE:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
911 self.process_inline(i)
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
912 elif i.nodeType == Node.TEXT_NODE:
559
77e2149d7eab fix gui converter html \n processing
Thomas Waldmann <tw@waldmann-edv.de>
parents: 544
diff changeset
913 self.text.append(i.data.strip('\n').replace('\n', ' '))
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
914
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
915 def process_pre(self, node):
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
916 self.process_preformatted_item(node)
564
a7f8bfd10322 gui converter: use (soft) new_line object more, strip trailing ws
Thomas Waldmann <tw@waldmann-edv.de>
parents: 563
diff changeset
917 self.text.append(self.new_line)
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
918
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
919 def process_preformatted_item(self, node):
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
920 if node.hasAttribute("class"):
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
921 class_ = node.getAttribute("class")
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
922 else:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
923 class_ = None
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
924 if class_ == "comment": # we currently use this for stuff like ## or #acl
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
925 for i in node.childNodes:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
926 if i.nodeType == Node.TEXT_NODE:
3992
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
927 self.text.append(i.data.replace('\n', ''))
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
928 elif i.localName == 'br':
564
a7f8bfd10322 gui converter: use (soft) new_line object more, strip trailing ws
Thomas Waldmann <tw@waldmann-edv.de>
parents: 563
diff changeset
929 self.text.append(self.new_line)
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
930 else:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
931 pass
3992
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
932 else:
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
933 content_buffer = []
3990
645d031f4eab fix gui editor remove nested markup problem
Byeongweon [tasyblue@gmail.com]
parents: 3988
diff changeset
934 longest_inner_formater = ''
3996
40f10410e0b3 fix bug : MoinMoinBugs/GuiEditorDestroysParserSyntax
Byeongweon [tasyblue@gmail.com]
parents: 3993
diff changeset
935 bang_args = ''
3998
63a209dee4b3 fix delimiter process routine to handle close delimiter also. see MoinMoinBugs/GuiEditorCantNest
Byeongweon [tasyblue@gmail.com]
parents: 3997
diff changeset
936 delimiters = []
3992
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
937
4008
740e37c6ae92 fix code for PEP8
Byeongweon [tasyblue@gmail.com]
parents: 4003
diff changeset
938 """
3997
238eceaf862d add comment about prossible error
Byeongweon [tasyblue@gmail.com]
parents: 3996
diff changeset
939 below code fixed for MoinMoinBugs/GuiEditorCantNest bug
238eceaf862d add comment about prossible error
Byeongweon [tasyblue@gmail.com]
parents: 3996
diff changeset
940 this has problem when outer delimiter has two more { than inside one
238eceaf862d add comment about prossible error
Byeongweon [tasyblue@gmail.com]
parents: 3996
diff changeset
941 e.g. {{{{{{ {{{ foo }}} }}}}}} --> {{{{ {{{ foo }}} }}}}
4009
579b76b20c8c add additional comment about MoinMoinBugs/GuiEditorCantNest bug
Byeongweon [tasyblue@gmail.com]
parents: 4008
diff changeset
942 {{{foo {{{ }}} foo}}} --> {{{{ {{{ }}} }}}}
4008
740e37c6ae92 fix code for PEP8
Byeongweon [tasyblue@gmail.com]
parents: 4003
diff changeset
943 """
3997
238eceaf862d add comment about prossible error
Byeongweon [tasyblue@gmail.com]
parents: 3996
diff changeset
944
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
945 for i in node.childNodes:
3992
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
946 if i.nodeType == Node.TEXT_NODE:
3998
63a209dee4b3 fix delimiter process routine to handle close delimiter also. see MoinMoinBugs/GuiEditorCantNest
Byeongweon [tasyblue@gmail.com]
parents: 3997
diff changeset
947 # get longest pre tag({{{ or }}}) from content
63a209dee4b3 fix delimiter process routine to handle close delimiter also. see MoinMoinBugs/GuiEditorCantNest
Byeongweon [tasyblue@gmail.com]
parents: 3997
diff changeset
948 delimiters.extend(re.compile("((?u){+)").findall(i.data))
63a209dee4b3 fix delimiter process routine to handle close delimiter also. see MoinMoinBugs/GuiEditorCantNest
Byeongweon [tasyblue@gmail.com]
parents: 3997
diff changeset
949 delimiters.extend(re.compile("((?u)}+)").findall(i.data))
4020
b1e192a3651a converter doesn't remove first line of preformated text when it's not empty
Byeongweon [tasyblue@gmail.com]
parents: 4015
diff changeset
950 # when first line is empty, start iteration second line of i.data
b1e192a3651a converter doesn't remove first line of preformated text when it's not empty
Byeongweon [tasyblue@gmail.com]
parents: 4015
diff changeset
951 data_lines = i.data.rstrip().split('\n')
b1e192a3651a converter doesn't remove first line of preformated text when it's not empty
Byeongweon [tasyblue@gmail.com]
parents: 4015
diff changeset
952 if data_lines[0].strip() == '':
b1e192a3651a converter doesn't remove first line of preformated text when it's not empty
Byeongweon [tasyblue@gmail.com]
parents: 4015
diff changeset
953 data_lines = data_lines[1:]
b1e192a3651a converter doesn't remove first line of preformated text when it's not empty
Byeongweon [tasyblue@gmail.com]
parents: 4015
diff changeset
954 for line in data_lines:
3996
40f10410e0b3 fix bug : MoinMoinBugs/GuiEditorDestroysParserSyntax
Byeongweon [tasyblue@gmail.com]
parents: 3993
diff changeset
955 if line.strip().startswith('#!'):
40f10410e0b3 fix bug : MoinMoinBugs/GuiEditorDestroysParserSyntax
Byeongweon [tasyblue@gmail.com]
parents: 3993
diff changeset
956 if bang_args == '':
40f10410e0b3 fix bug : MoinMoinBugs/GuiEditorDestroysParserSyntax
Byeongweon [tasyblue@gmail.com]
parents: 3993
diff changeset
957 bang_args = line.strip()
40f10410e0b3 fix bug : MoinMoinBugs/GuiEditorDestroysParserSyntax
Byeongweon [tasyblue@gmail.com]
parents: 3993
diff changeset
958 else:
40f10410e0b3 fix bug : MoinMoinBugs/GuiEditorDestroysParserSyntax
Byeongweon [tasyblue@gmail.com]
parents: 3993
diff changeset
959 content_buffer.extend([line, self.new_line])
40f10410e0b3 fix bug : MoinMoinBugs/GuiEditorDestroysParserSyntax
Byeongweon [tasyblue@gmail.com]
parents: 3993
diff changeset
960 else:
40f10410e0b3 fix bug : MoinMoinBugs/GuiEditorDestroysParserSyntax
Byeongweon [tasyblue@gmail.com]
parents: 3993
diff changeset
961 content_buffer.extend([line, self.new_line])
3992
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
962 elif i.localName == 'br':
3990
645d031f4eab fix gui editor remove nested markup problem
Byeongweon [tasyblue@gmail.com]
parents: 3988
diff changeset
963 content_buffer.append(self.new_line_dont_remove)
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
964 else:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
965 pass
3992
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
966 #print i.localName
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
967
3998
63a209dee4b3 fix delimiter process routine to handle close delimiter also. see MoinMoinBugs/GuiEditorCantNest
Byeongweon [tasyblue@gmail.com]
parents: 3997
diff changeset
968 if delimiters:
63a209dee4b3 fix delimiter process routine to handle close delimiter also. see MoinMoinBugs/GuiEditorCantNest
Byeongweon [tasyblue@gmail.com]
parents: 3997
diff changeset
969 longest_inner_formater = max(delimiters)
63a209dee4b3 fix delimiter process routine to handle close delimiter also. see MoinMoinBugs/GuiEditorCantNest
Byeongweon [tasyblue@gmail.com]
parents: 3997
diff changeset
970
3992
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
971 if (len(longest_inner_formater) >= 3):
3996
40f10410e0b3 fix bug : MoinMoinBugs/GuiEditorDestroysParserSyntax
Byeongweon [tasyblue@gmail.com]
parents: 3993
diff changeset
972 self.text.extend([("{" * (len(longest_inner_formater) + 1)) + bang_args, \
40f10410e0b3 fix bug : MoinMoinBugs/GuiEditorDestroysParserSyntax
Byeongweon [tasyblue@gmail.com]
parents: 3993
diff changeset
973 self.new_line])
3992
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
974 self.text.extend(content_buffer)
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
975 self.text.extend(["}" * (len(longest_inner_formater) + 1), \
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
976 self.new_line])
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
977 else:
3996
40f10410e0b3 fix bug : MoinMoinBugs/GuiEditorDestroysParserSyntax
Byeongweon [tasyblue@gmail.com]
parents: 3993
diff changeset
978 self.text.extend(["{{{"+bang_args, self.new_line])
3992
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
979 self.text.extend(content_buffer)
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
980 self.text.extend(["}}}", self.new_line])
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
981
999
97ce857bdebf whitespace-only cleanup and minor style changes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 878
diff changeset
982 _alignment = {"left": "(",
97ce857bdebf whitespace-only cleanup and minor style changes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 878
diff changeset
983 "center": ":",
97ce857bdebf whitespace-only cleanup and minor style changes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 878
diff changeset
984 "right": ")",
97ce857bdebf whitespace-only cleanup and minor style changes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 878
diff changeset
985 "top": "^",
97ce857bdebf whitespace-only cleanup and minor style changes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 878
diff changeset
986 "bottom": "v"}
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
987
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
988 def _check_length(self, value):
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
989 try:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
990 int(value)
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
991 return value + 'px'
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
992 except ValueError:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
993 return value
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
994
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
995 def _table_style(self, node):
2862
8c1d40768df7 gedit formatter/converter: fix links/transclusion (suppressing default alt texts needs more work)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2852
diff changeset
996 # TODO: attrs = get_attrs(node)
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
997 result = []
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
998 if node.hasAttribute("bgcolor"):
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
999 value = node.getAttribute("bgcolor")
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1000 match = re.match(r"rgb\((\d+),\s*(\d+),\s*(\d+)\)", value)
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1001 if match:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1002 result.append('tablebgcolor="#%X%X%X"' %
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1003 (int(match.group(1)),
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1004 int(match.group(2)),
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1005 int(match.group(3))))
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1006 else:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1007 result.append('tablebgcolor="%s"' % value)
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1008 if node.hasAttribute("width"):
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1009 value = node.getAttribute("width")
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1010 result.append('tablewidth="%s"' % self._check_length(value))
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1011 if node.hasAttribute("height"):
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1012 value = node.getAttribute("height")
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1013 result.append('tableheight="%s"' % self._check_length(value))
277
08778f685aaf begin fixing http://moinmoin.wikiwikiweb.de/MoinMoinBugs/GuiEditorDestroysTableStyles (incomplete)
Thomas Waldmann <tw@waldmann-edv.de>
parents: 276
diff changeset
1014 if node.hasAttribute("align"):
08778f685aaf begin fixing http://moinmoin.wikiwikiweb.de/MoinMoinBugs/GuiEditorDestroysTableStyles (incomplete)
Thomas Waldmann <tw@waldmann-edv.de>
parents: 276
diff changeset
1015 value = node.getAttribute("align")
08778f685aaf begin fixing http://moinmoin.wikiwikiweb.de/MoinMoinBugs/GuiEditorDestroysTableStyles (incomplete)
Thomas Waldmann <tw@waldmann-edv.de>
parents: 276
diff changeset
1016 result.append('tablealign="%s"' % value)
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1017 if node.hasAttribute("style"):
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1018 result.append('tablestyle="%s"' % node.getAttribute("style"))
531
f6a74f85b9d7 fix tableclass attr for gui editor
Thomas Waldmann <tw@waldmann-edv.de>
parents: 488
diff changeset
1019 if node.hasAttribute("class"):
f6a74f85b9d7 fix tableclass attr for gui editor
Thomas Waldmann <tw@waldmann-edv.de>
parents: 488
diff changeset
1020 result.append('tableclass="%s"' % node.getAttribute("class"))
544
bdaea0dcf3b1 converter: fix table/row/cell style spaces
Thomas Waldmann <tw@waldmann-edv.de>
parents: 531
diff changeset
1021 return " ".join(result).strip()
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1022
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1023 def _row_style(self, node):
2862
8c1d40768df7 gedit formatter/converter: fix links/transclusion (suppressing default alt texts needs more work)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2852
diff changeset
1024 # TODO: attrs = get_attrs(node)
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1025 result = []
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1026 if node.hasAttribute("bgcolor"):
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1027 value = node.getAttribute("bgcolor")
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1028 match = re.match(r"rgb\((\d+),\s*(\d+),\s*(\d+)\)", value)
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1029 if match:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1030 result.append('rowbgcolor="#%X%X%X"' %
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1031 (int(match.group(1)),
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1032 int(match.group(2)),
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1033 int(match.group(3))))
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1034 else:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1035 result.append('rowbgcolor="%s"' % value)
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1036 if node.hasAttribute("style"):
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1037 result.append('rowstyle="%s"' % node.getAttribute("style"))
1649
65d05bbcd436 GUI converter: don't throw away rowclass in tables
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1515
diff changeset
1038 if node.hasAttribute("class"):
65d05bbcd436 GUI converter: don't throw away rowclass in tables
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1515
diff changeset
1039 result.append('rowclass="%s"' % node.getAttribute("class"))
544
bdaea0dcf3b1 converter: fix table/row/cell style spaces
Thomas Waldmann <tw@waldmann-edv.de>
parents: 531
diff changeset
1040 return " ".join(result).strip()
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1041
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1042 def _cell_style(self, node):
2862
8c1d40768df7 gedit formatter/converter: fix links/transclusion (suppressing default alt texts needs more work)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2852
diff changeset
1043 # TODO: attrs = get_attrs(node)
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1044 if node.hasAttribute("rowspan"):
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1045 rowspan = ("|%s" % node.getAttribute("rowspan"))
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1046 else:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1047 rowspan = ""
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1048
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1049 if node.hasAttribute("colspan"):
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1050 colspan = int(node.getAttribute("colspan"))
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1051 else:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1052 colspan = 1
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1053
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1054 spanning = rowspan or colspan > 1
999
97ce857bdebf whitespace-only cleanup and minor style changes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 878
diff changeset
1055
544
bdaea0dcf3b1 converter: fix table/row/cell style spaces
Thomas Waldmann <tw@waldmann-edv.de>
parents: 531
diff changeset
1056 align = ""
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1057 result = []
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1058 if node.hasAttribute("bgcolor"):
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1059 value = node.getAttribute("bgcolor")
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1060 match = re.match(r"rgb\((\d+),\s*(\d+),\s*(\d+)\)", value)
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1061 if match:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1062 result.append("#%X%X%X" % (int(match.group(1)),
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1063 int(match.group(2)),
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1064 int(match.group(3))))
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1065 else:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1066 result.append('bgcolor="%s"' % value)
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1067 if node.hasAttribute("align"):
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1068 value = node.getAttribute("align")
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1069 if not spanning or value != "center":
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1070 # ignore "center" in spanning cells
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1071 align += self._alignment.get(value, "")
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1072 if node.hasAttribute("valign"):
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1073 value = node.getAttribute("valign")
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1074 if not spanning or value != "center":
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1075 # ignore "center" in spanning cells
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1076 align += self._alignment.get(value, "")
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1077 if node.hasAttribute("width"):
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1078 value = node.getAttribute("width")
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1079 if value[-1] == "%":
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1080 align += value
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1081 else:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1082 result.append('width="%s"' % self._check_length(value))
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1083 if node.hasAttribute("height"):
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1084 value = node.getAttribute("height")
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1085 result.append('height="%s"' % self._check_length(value))
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1086 if node.hasAttribute("class"):
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1087 result.append('class="%s"' % node.getAttribute("class"))
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1088 if node.hasAttribute("id"):
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1089 result.append('id="%s"' % node.getAttribute("id"))
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1090 if node.hasAttribute("style"):
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1091 result.append('style="%s"' % node.getAttribute("style"))
999
97ce857bdebf whitespace-only cleanup and minor style changes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 878
diff changeset
1092
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1093 if align:
862
7e103a2591db fixed table alignment in gui editor converter (backport to 1.5)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 854
diff changeset
1094 result.insert(0, "%s" % align)
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1095 result.append(rowspan)
544
bdaea0dcf3b1 converter: fix table/row/cell style spaces
Thomas Waldmann <tw@waldmann-edv.de>
parents: 531
diff changeset
1096 return " ".join(result).strip()
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1097
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1098 def process_table(self, node, style=""):
4003
9ab4430107e9 fix MoinMoinBugs/GuiEditorIndentingChangedForTables bug
Byeongweon [tasyblue@gmail.com]
parents: 4001
diff changeset
1099 if self.depth == 0:
9ab4430107e9 fix MoinMoinBugs/GuiEditorIndentingChangedForTables bug
Byeongweon [tasyblue@gmail.com]
parents: 4001
diff changeset
1100 self.text.append(self.new_line)
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1101 self.new_table = True
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1102 style += self._table_style(node)
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1103 for i in node.childNodes:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1104 if i.nodeType == Node.ELEMENT_NODE:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1105 name = i.localName
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1106 if name == 'tr':
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1107 self.process_table_record(i, style)
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1108 style = ""
294
3cbbedfb89af converter: handle thead and tfoot tags
Thomas Waldmann <tw@waldmann-edv.de>
parents: 277
diff changeset
1109 elif name in ('thead', 'tbody', 'tfoot'):
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1110 self.process_table(i, style)
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1111 elif name == 'caption':
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1112 self.process_caption(node, i, style)
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1113 style = ''
2849
9ed226998cce text_html_text_moin_wiki: ignore 'strong' in process_table
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 2847
diff changeset
1114 elif name in ('col', 'colgroup', 'strong', ):
1757
d4f3fc3f0afc gui converter: don't crash on col/colgroup/meta/a (ported from 1.5-788)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1740
diff changeset
1115 pass # we don't support these, but we just ignore them
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1116 else:
48
8a37de5a6b79 fixed broken tests package, moved ConvertError to convert module
Nir Soffer <nirs@freeshell.org>
parents: 37
diff changeset
1117 raise ConvertError("process_table: Don't support %s element" % name)
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1118 #else:
48
8a37de5a6b79 fixed broken tests package, moved ConvertError to convert module
Nir Soffer <nirs@freeshell.org>
parents: 37
diff changeset
1119 # raise ConvertError("Unexpected node: %r" % i)
2847
dc9048024d49 text_html_text_moin_wiki: reverted changeset 2840
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 2840
diff changeset
1120 self.text.append(self.new_line_dont_remove)
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1121
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1122 def process_caption(self, table, node, style=""):
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1123 # get first row
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1124 for i in table.childNodes:
294
3cbbedfb89af converter: handle thead and tfoot tags
Thomas Waldmann <tw@waldmann-edv.de>
parents: 277
diff changeset
1125 if i.localName in ('thead', 'tbody', 'tfoot'): # XXX is this correct?
3cbbedfb89af converter: handle thead and tfoot tags
Thomas Waldmann <tw@waldmann-edv.de>
parents: 277
diff changeset
1126 #if i.localName == 'tbody': (old version)
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1127 for i in i.childNodes:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1128 if i.localName == 'tr':
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1129 break
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1130 break
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1131 elif i.localName == 'tr':
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1132 break
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1133 # count columns
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1134 if i.localName == 'tr':
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1135 colspan = 0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1136 for td in i.childNodes:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1137 if not td.nodeType == Node.ELEMENT_NODE:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1138 continue
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1139 span = td.getAttribute('colspan')
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1140 try:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1141 colspan += int(span)
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1142 except ValueError:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1143 colspan += 1
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1144 else:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1145 colspan = 1
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1146 text = self.node_list_text_only(node.childNodes).replace('\n', ' ').strip()
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1147 if text:
1736
6e4acd9904d7 fix wrong merging of significant newline chars (fixes wrong removal of empty lines in pre sections, fixes wrong merging of tables separates by empty line, fixes wrong removal of li/ol gaps, add empty line after lists)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1725
diff changeset
1148 self.text.extend(["%s'''%s%s'''||" % ('||' * colspan, style, text), self.new_line_dont_remove])
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1149
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1150 def process_table_data(self, node, style=""):
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1151 if node.hasAttribute("colspan"):
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1152 colspan = int(node.getAttribute("colspan"))
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1153 else:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1154 colspan = 1
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1155 self.text.append("||" * colspan)
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1156
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1157 style += self._cell_style(node)
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1158 if style:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1159 self.text.append("<%s>" % style)
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1160
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1161 found = False
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1162 for i in node.childNodes:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1163 name = i.localName
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1164 if name == 'p':
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1165 self.process_paragraph_item(i)
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1166 self.text.append(self.white_space)
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1167 found = True
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1168 if not found:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1169 for i in node.childNodes:
2901
5cd9d4c041b9 text_html_text_moin_wiki: linebreak in table cell should be written into wiki text as <<BR>>
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 2887
diff changeset
1170 name = i.localName
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1171 if i.nodeType == Node.ELEMENT_NODE:
2855
f003d451be90 text_html_text_moin_wiki: br for empty cell of OOo to gui replaced by whitespace at process_table_data
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 2852
diff changeset
1172 if name == 'br':
2901
5cd9d4c041b9 text_html_text_moin_wiki: linebreak in table cell should be written into wiki text as <<BR>>
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 2887
diff changeset
1173 # if we get a br for a cell from e.g. cut and paste from OOo
5cd9d4c041b9 text_html_text_moin_wiki: linebreak in table cell should be written into wiki text as <<BR>>
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 2887
diff changeset
1174 # or if someone simulates a list by enter in a cell
5cd9d4c041b9 text_html_text_moin_wiki: linebreak in table cell should be written into wiki text as <<BR>>
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 2887
diff changeset
1175 # it should be appended as macro BR.
5cd9d4c041b9 text_html_text_moin_wiki: linebreak in table cell should be written into wiki text as <<BR>>
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 2887
diff changeset
1176 self.text.append('<<BR>>')
2855
f003d451be90 text_html_text_moin_wiki: br for empty cell of OOo to gui replaced by whitespace at process_table_data
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 2852
diff changeset
1177 found = True
2901
5cd9d4c041b9 text_html_text_moin_wiki: linebreak in table cell should be written into wiki text as <<BR>>
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 2887
diff changeset
1178 continue
2855
f003d451be90 text_html_text_moin_wiki: br for empty cell of OOo to gui replaced by whitespace at process_table_data
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 2852
diff changeset
1179 else:
f003d451be90 text_html_text_moin_wiki: br for empty cell of OOo to gui replaced by whitespace at process_table_data
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 2852
diff changeset
1180 self.process_inline(i)
f003d451be90 text_html_text_moin_wiki: br for empty cell of OOo to gui replaced by whitespace at process_table_data
Reimar Bauer <rb.pr