annotate MoinMoin/converter/text_html_text_moin_wiki.py @ 6101:316986758258

remove MoinMoin.support.difflib
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Tue, 06 Sep 2016 00:21:08 +0200
parents e77e7448ae1f
children
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
5286
668606f6a255 Roundtripping works now for PDF, Doc, ...from GUI editor to text editor and vice versa.
Josef Meier <jo.meier@gmx.de>
parents: 4948
diff changeset
11 import urlparse
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
12 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
13
1914
eb68960b1dfb remove unused imports
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1908
diff changeset
14 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
15 from MoinMoin.error import ConvertError
5537
8ee65df9cbe9 fix werkzeug imports (always import from werkzeug, except if documented otherwise)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 5286
diff changeset
16 from werkzeug import url_decode
4125
8662bba9e431 GUI editor converter: fix roundtripping of free interwiki links
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4124
diff changeset
17 from MoinMoin.parser.text_moin_wiki import Parser as WikiParser
8662bba9e431 GUI editor converter: fix roundtripping of free interwiki links
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4124
diff changeset
18 interwiki_re = re.compile(WikiParser.interwiki_rule, re.VERBOSE|re.UNICODE)
8662bba9e431 GUI editor converter: fix roundtripping of free interwiki links
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4124
diff changeset
19
5286
668606f6a255 Roundtripping works now for PDF, Doc, ...from GUI editor to text editor and vice versa.
Josef Meier <jo.meier@gmx.de>
parents: 4948
diff changeset
20
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
21 # 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
22 # 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
23 # 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
24 # 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
25 dtd = ur'''
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
26 <!DOCTYPE html [
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
27 <!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
28 <!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
29 <!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
30 <!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
31 <!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
32 <!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
33 <!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
34 <!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
35 <!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
36 <!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
37 <!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
38 <!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
39 <!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
40 <!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
41 <!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
42 <!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
43 <!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
44 <!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
45 <!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
46 <!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
47 <!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
48 <!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
49 <!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
50 <!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
51 <!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
52 <!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
53 <!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
54 <!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
55 <!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
56 <!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
57 <!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
58 <!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
59 <!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
60 <!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
61 <!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
62 <!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
63 <!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
64 <!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
65 <!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
66 <!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
67 <!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
68 <!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
69 <!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
70 <!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
71 <!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
72 <!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
73 <!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
74 <!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
75 <!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
76 <!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
77 <!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
78 <!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
79 <!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
80 <!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
81 <!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
82 <!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
83 <!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
84 <!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
85 <!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
86 <!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
87 <!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
88 <!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
89 <!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
90 <!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
91 <!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
92 <!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
93 <!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
94 <!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
95 <!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
96 <!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
97 <!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
98 <!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
99 <!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
100 <!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
101 <!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
102 <!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
103 <!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
104 <!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
105 <!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
106 <!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
107 <!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
108 <!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
109 <!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
110 <!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
111 <!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
112 <!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
113 <!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
114 <!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
115 <!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
116 <!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
117 <!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
118 <!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
119 <!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
120 <!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
121 <!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
122 <!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
123
226b379bde22 added 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 <!-- 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
125 <!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
126
226b379bde22 added 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 <!-- 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
128 <!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
129 <!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
130 <!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
131 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
132 <!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
133 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
134 <!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
135 <!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
136 <!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
137 <!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
138 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
139 <!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
140 <!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
141 <!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
142 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
143 <!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
144 <!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
145 <!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
146 <!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
147 <!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
148 <!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
149 <!-- 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
150 <!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
151 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
152 <!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
153 <!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
154 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
155 <!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
156 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
157 <!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
158 <!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
159 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
160 <!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
161 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
162
226b379bde22 added 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 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
164 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
165 <!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
166 <!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
167 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
168 <!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
169 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
170 <!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
171 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
172 <!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
173 <!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
174 <!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
175 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
176 <!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
177 <!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
178 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
179 <!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
180 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
181 <!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
182 <!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
183 <!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
184 <!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
185 <!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
186 <!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
187 <!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
188 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
189 <!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
190 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
191 <!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
192 <!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
193 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
194 <!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
195 <!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
196 <!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
197 <!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
198 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
199 <!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
200 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
201 <!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
202 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
203 <!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
204
226b379bde22 added 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 <!-- 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
206 <!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
207 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
208 <!-- 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
209 <!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
210 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
211 <!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
212 <!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
213 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
214 <!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
215 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
216 <!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
217
226b379bde22 added 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 <!-- 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
219 <!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
220 = 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
221 <!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
222 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
223 <!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
224 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
225 <!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
226 <!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
227 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
228 <!-- 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
229 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
230
226b379bde22 added 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 <!-- 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
232 <!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
233 <!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
234 <!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
235 <!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
236 <!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
237 <!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
238 = 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
239 <!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
240 <!-- 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
241 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
242 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
243 <!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
244 <!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
245 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
246 <!-- 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
247 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
248 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
249 <!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
250 <!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
251 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
252
226b379bde22 added 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 <!-- 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
254 <!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
255 <!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
256 <!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
257 <!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
258 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
259 <!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
260 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
261 <!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
262 <!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
263 <!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
264 <!-- 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
265 <!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
266 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
267 <!-- 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
268 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
269 <!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
270 <!-- 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
271 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
272 <!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
273 <!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
274 <!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
275 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
276 <!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
277 <!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
278 <!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
279 <!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
280 <!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
281 <!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
282 <!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
283 <!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
284 <!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
285 <!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
286 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
287 <!-- 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
288 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
289 <!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
290 <!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
291 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
292 <!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
293 <!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
294 <!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
295 <!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
296 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
297 <!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
298 <!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
299 <!-- 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
300 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
301 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
302 <!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
303 <!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
304 <!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
305 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
306 <!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
307 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
308 <!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
309 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
310 <!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
311 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
312 <!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
313 <!-- 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
314
226b379bde22 added 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 <!-- 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
316 <!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
317 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
318 <!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
319 <!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
320 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
321 <!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
322 <!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
323 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
324 <!-- 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
325 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
326 <!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
327 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
328 <!-- 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
329 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
330
226b379bde22 added 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 <!-- 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
332 <!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
333
226b379bde22 added 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 <!-- 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
335 <!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
336 <!-- 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
337 <!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
338 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
339 <!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
340 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
341 <!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
342
226b379bde22 added 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 <!-- 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
344 <!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
345 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
346 <!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
347 <!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
348 <!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
349
226b379bde22 added 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 <!-- 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
351 <!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
352 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
353 <!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
354 <!-- 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
355 <!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
356 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
357 <!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
358 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
359 <!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
360 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
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 <!-- 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
363 <!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
364 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
365 <!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
366
226b379bde22 added 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 <!-- 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
368 <!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
369 <!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
370 <!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
371 <!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
372 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
373 <!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
374 <!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
375 <!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
376 <!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
377 <!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
378 <!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
379 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
380 <!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
381 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
382 <!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
383 <!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
384 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
385 <!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
386 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
387 <!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
388 <!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
389 <!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
390 <!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
391 <!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
392 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
393 <!-- 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
394 <!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
395 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
396 <!-- 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
397 <!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
398
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
399 ]>
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
400 '''
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
401
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
402 class visitor(object):
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
403 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
404 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
405
188
3b15ec7497bb fixed GUI editor crash on save, some cosmetical changes
Thomas Waldmann <tw@waldmann-edv.de>
parents: 151
diff changeset
406 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
407 for node in nodelist:
3b15ec7497bb fixed GUI editor crash on save, some cosmetical changes
Thomas Waldmann <tw@waldmann-edv.de>
parents: 151
diff changeset
408 self.visit(node)
19
6772e845059d fix for gecko paste link brokenness, src cosmetics
Thomas Waldmann <tw@waldmann-edv.de>
parents: 10
diff changeset
409
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
410 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
411 nodeType = node.nodeType
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
412 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
413 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
414 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
415 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
416 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
417 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
418 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
419 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
420
19
6772e845059d fix for gecko paste link brokenness, src cosmetics
Thomas Waldmann <tw@waldmann-edv.de>
parents: 10
diff changeset
421 def visit_element(self, node):
6772e845059d fix for gecko paste link brokenness, src cosmetics
Thomas Waldmann <tw@waldmann-edv.de>
parents: 10
diff changeset
422 if len(node.childNodes):
6772e845059d fix for gecko paste link brokenness, src cosmetics
Thomas Waldmann <tw@waldmann-edv.de>
parents: 10
diff changeset
423 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
424
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
425 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
426 pass
999
97ce857bdebf whitespace-only cleanup and minor style changes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 878
diff changeset
427
19
6772e845059d fix for gecko paste link brokenness, src cosmetics
Thomas Waldmann <tw@waldmann-edv.de>
parents: 10
diff changeset
428 def visit_text(self, node):
6772e845059d fix for gecko paste link brokenness, src cosmetics
Thomas Waldmann <tw@waldmann-edv.de>
parents: 10
diff changeset
429 pass
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
430
19
6772e845059d fix for gecko paste link brokenness, src cosmetics
Thomas Waldmann <tw@waldmann-edv.de>
parents: 10
diff changeset
431 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
432 pass
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
433
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
434
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
435 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
436
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
437 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
438 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
439 # 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
440 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
441 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
442 # 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
443 if data == '':
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
444 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
445 else:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
446 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
447 # Remove empty paragraphs
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
448 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
449 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
450
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
451 if node.hasChildNodes():
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
452 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
453
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
454
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
455 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
456 white_space = object()
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
457 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
458 new_line_dont_remove = object()
854
a71bcc0f27c3 fixed MoinMoinBugs:GuiEditorDeletesNewBulletText
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 834
diff changeset
459
19
6772e845059d fix for gecko paste link brokenness, src cosmetics
Thomas Waldmann <tw@waldmann-edv.de>
parents: 10
diff changeset
460 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
461 self.request = request
19
6772e845059d fix for gecko paste link brokenness, src cosmetics
Thomas Waldmann <tw@waldmann-edv.de>
parents: 10
diff changeset
462 self.pagename = pagename
999
97ce857bdebf whitespace-only cleanup and minor style changes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 878
diff changeset
463
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
464 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
465 self.depth = 0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
466 self.text = []
428
f4d09019cbb8 fixed MoinMoinBugs/ProcessInlineDontSupportUlElement, some converter code cleanup
Thomas Waldmann <tw@waldmann-edv.de>
parents: 407
diff changeset
467 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
468 self.check_whitespace()
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
469 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
470
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
471 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
472 i = 0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
473 text = self.text
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
474 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
475 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
476 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
477 del text[i]
275
8236b972ea7d better use .startswith/.endswith instead of [0]/[-1]
Thomas Waldmann <tw@waldmann-edv.de>
parents: 258
diff changeset
478 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
479 # 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
480 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
481 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
482 # 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
483 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
484 # 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
485 del text[i]
275
8236b972ea7d better use .startswith/.endswith instead of [0]/[-1]
Thomas Waldmann <tw@waldmann-edv.de>
parents: 258
diff changeset
486 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
487 # 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
488 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
489 else:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
490 text[i] = " "
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
491 i += 1
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
492 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
493 if i == 0:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
494 del text[i]
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
495 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
496 text[i] = "\n"
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
497 i += 1
275
8236b972ea7d better use .startswith/.endswith instead of [0]/[-1]
Thomas Waldmann <tw@waldmann-edv.de>
parents: 258
diff changeset
498 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
499 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
500 del text[i]
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
501 else:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
502 text[i] = "\n"
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
503 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
504 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
505 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
506 i += 1
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
507 else:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
508 i += 1
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
509
428
f4d09019cbb8 fixed MoinMoinBugs/ProcessInlineDontSupportUlElement, some converter code cleanup
Thomas Waldmann <tw@waldmann-edv.de>
parents: 407
diff changeset
510 def visit_text(self, node):
f4d09019cbb8 fixed MoinMoinBugs/ProcessInlineDontSupportUlElement, some converter code cleanup
Thomas Waldmann <tw@waldmann-edv.de>
parents: 407
diff changeset
511 self.text.append(node.data)
f4d09019cbb8 fixed MoinMoinBugs/ProcessInlineDontSupportUlElement, some converter code cleanup
Thomas Waldmann <tw@waldmann-edv.de>
parents: 407
diff changeset
512
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
513 def visit_element(self, node):
276
9b21b7907167 this should fix MoinMoinBugs/GuiEditorTypeErrorWhenSaving
Thomas Waldmann <tw@waldmann-edv.de>
parents: 275
diff changeset
514 name = node.localName
9b21b7907167 this should fix MoinMoinBugs/GuiEditorTypeErrorWhenSaving
Thomas Waldmann <tw@waldmann-edv.de>
parents: 275
diff changeset
515 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
516 return
999
97ce857bdebf whitespace-only cleanup and minor style changes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 878
diff changeset
517 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
518 if func:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
519 func(node)
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
520 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
521 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
522
188
3b15ec7497bb fixed GUI editor crash on save, some cosmetical changes
Thomas Waldmann <tw@waldmann-edv.de>
parents: 151
diff changeset
523 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
524 for node in nodelist:
3b15ec7497bb fixed GUI editor crash on save, some cosmetical changes
Thomas Waldmann <tw@waldmann-edv.de>
parents: 151
diff changeset
525 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
526 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
527
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
528 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
529 result = []
188
3b15ec7497bb fixed GUI editor crash on save, some cosmetical changes
Thomas Waldmann <tw@waldmann-edv.de>
parents: 151
diff changeset
530 for node in nodelist:
3b15ec7497bb fixed GUI editor crash on save, some cosmetical changes
Thomas Waldmann <tw@waldmann-edv.de>
parents: 151
diff changeset
531 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
532 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
533 else:
188
3b15ec7497bb fixed GUI editor crash on save, some cosmetical changes
Thomas Waldmann <tw@waldmann-edv.de>
parents: 151
diff changeset
534 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
535 return "".join(result)
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
536
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
537 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
538 """ 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
539 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
540 """
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 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
542 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
543 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
544 # 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
545 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
546 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
547 # 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
548 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
549 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
550 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
551 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
552 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
553 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
554 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
555 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
556 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
557 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
558
428
f4d09019cbb8 fixed MoinMoinBugs/ProcessInlineDontSupportUlElement, some converter code cleanup
Thomas Waldmann <tw@waldmann-edv.de>
parents: 407
diff changeset
559 def process_page(self, node):
f4d09019cbb8 fixed MoinMoinBugs/ProcessInlineDontSupportUlElement, some converter code cleanup
Thomas Waldmann <tw@waldmann-edv.de>
parents: 407
diff changeset
560 for i in node.childNodes:
f4d09019cbb8 fixed MoinMoinBugs/ProcessInlineDontSupportUlElement, some converter code cleanup
Thomas Waldmann <tw@waldmann-edv.de>
parents: 407
diff changeset
561 if i.nodeType == Node.ELEMENT_NODE:
f4d09019cbb8 fixed MoinMoinBugs/ProcessInlineDontSupportUlElement, some converter code cleanup
Thomas Waldmann <tw@waldmann-edv.de>
parents: 407
diff changeset
562 self.visit_element(i)
f4d09019cbb8 fixed MoinMoinBugs/ProcessInlineDontSupportUlElement, some converter code cleanup
Thomas Waldmann <tw@waldmann-edv.de>
parents: 407
diff changeset
563 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
564 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
565 if txt:
f4d09019cbb8 fixed MoinMoinBugs/ProcessInlineDontSupportUlElement, some converter code cleanup
Thomas Waldmann <tw@waldmann-edv.de>
parents: 407
diff changeset
566 self.text.append(txt)
f4d09019cbb8 fixed MoinMoinBugs/ProcessInlineDontSupportUlElement, some converter code cleanup
Thomas Waldmann <tw@waldmann-edv.de>
parents: 407
diff changeset
567 #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
568 #elif i.nodeType == Node.COMMENT_NODE:
f4d09019cbb8 fixed MoinMoinBugs/ProcessInlineDontSupportUlElement, some converter code cleanup
Thomas Waldmann <tw@waldmann-edv.de>
parents: 407
diff changeset
569 # self.text.append(i.data)
f4d09019cbb8 fixed MoinMoinBugs/ProcessInlineDontSupportUlElement, some converter code cleanup
Thomas Waldmann <tw@waldmann-edv.de>
parents: 407
diff changeset
570 # 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
571
428
f4d09019cbb8 fixed MoinMoinBugs/ProcessInlineDontSupportUlElement, some converter code cleanup
Thomas Waldmann <tw@waldmann-edv.de>
parents: 407
diff changeset
572 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
573 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
574 # 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
575
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
576 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
577 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
578 if text:
4115
f35e8fc79e8b GUI editor: fix heading level roundtripping
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4058
diff changeset
579 depth = int(node.localName[1])
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
580 hstr = "=" * depth
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
581 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
582 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
583 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
584
428
f4d09019cbb8 fixed MoinMoinBugs/ProcessInlineDontSupportUlElement, some converter code cleanup
Thomas Waldmann <tw@waldmann-edv.de>
parents: 407
diff changeset
585 process_h1 = process_heading
f4d09019cbb8 fixed MoinMoinBugs/ProcessInlineDontSupportUlElement, some converter code cleanup
Thomas Waldmann <tw@waldmann-edv.de>
parents: 407
diff changeset
586 process_h2 = process_heading
f4d09019cbb8 fixed MoinMoinBugs/ProcessInlineDontSupportUlElement, some converter code cleanup
Thomas Waldmann <tw@waldmann-edv.de>
parents: 407
diff changeset
587 process_h3 = process_heading
f4d09019cbb8 fixed MoinMoinBugs/ProcessInlineDontSupportUlElement, some converter code cleanup
Thomas Waldmann <tw@waldmann-edv.de>
parents: 407
diff changeset
588 process_h4 = process_heading
f4d09019cbb8 fixed MoinMoinBugs/ProcessInlineDontSupportUlElement, some converter code cleanup
Thomas Waldmann <tw@waldmann-edv.de>
parents: 407
diff changeset
589 process_h5 = process_heading
f4d09019cbb8 fixed MoinMoinBugs/ProcessInlineDontSupportUlElement, some converter code cleanup
Thomas Waldmann <tw@waldmann-edv.de>
parents: 407
diff changeset
590 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
591
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
592 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
593 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
594 #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
595 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
596 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
597 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
598 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
599 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
600 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
601 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
602 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
603 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
604 else:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
605 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
606 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
607 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
608 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
609 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
610 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
611 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
612 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
613 markup = ". "
fdfed78ebd72 replace functional expression with interation
Byeongweon [tasyblue@gmail.com]
parents: 4009
diff changeset
614 # set markup with white space when list element containes table
fdfed78ebd72 replace functional expression with interation
Byeongweon [tasyblue@gmail.com]
parents: 4009
diff changeset
615 for i in listitem.childNodes:
fdfed78ebd72 replace functional expression with interation
Byeongweon [tasyblue@gmail.com]
parents: 4009
diff changeset
616 if i.nodeType == Node.ELEMENT_NODE:
fdfed78ebd72 replace functional expression with interation
Byeongweon [tasyblue@gmail.com]
parents: 4009
diff changeset
617 if i.localName == 'table':
4496
c76d50dac855 text_html_text_moin_wiki: bug fix for GuiEditorBreaksIndentedTable
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 4126
diff changeset
618 markup = ""
4011
42526183b82b fix normal list notation didn't work problem
Byeongweon [tasyblue@gmail.com]
parents: 4010
diff changeset
619 else:
42526183b82b fix normal list notation didn't work problem
Byeongweon [tasyblue@gmail.com]
parents: 4010
diff changeset
620 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
621 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
622 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
623 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
624 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
625 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
626
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 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
628 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
629 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
630 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
631 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
632 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
633 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
634 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
635 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
636 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
637 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
638 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
639 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
640 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
641 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
642 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
643 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
644 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
645 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
646
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
647 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
648 self.depth += 1
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
649 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
650 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
651 name = i.localName
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
652 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
653 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
654 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
655 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
656 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
657 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
658 elif name == 'dl':
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
659 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
660 else:
48
8a37de5a6b79 fixed broken tests package, moved ConvertError to convert module
Nir Soffer <nirs@freeshell.org>
parents: 37
diff changeset
661 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
662 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
663 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
664 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
665
428
f4d09019cbb8 fixed MoinMoinBugs/ProcessInlineDontSupportUlElement, some converter code cleanup
Thomas Waldmann <tw@waldmann-edv.de>
parents: 407
diff changeset
666 process_ul = process_list
f4d09019cbb8 fixed MoinMoinBugs/ProcessInlineDontSupportUlElement, some converter code cleanup
Thomas Waldmann <tw@waldmann-edv.de>
parents: 407
diff changeset
667 process_ol = process_list
f4d09019cbb8 fixed MoinMoinBugs/ProcessInlineDontSupportUlElement, some converter code cleanup
Thomas Waldmann <tw@waldmann-edv.de>
parents: 407
diff changeset
668
560
b4eedd2147ff gui converter: fix processing of complex list elements
Thomas Waldmann <tw@waldmann-edv.de>
parents: 559
diff changeset
669 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
670 if need_indent:
b4eedd2147ff gui converter: fix processing of complex list elements
Thomas Waldmann <tw@waldmann-edv.de>
parents: 559
diff changeset
671 self.text.append(indent)
b4eedd2147ff gui converter: fix processing of complex list elements
Thomas Waldmann <tw@waldmann-edv.de>
parents: 559
diff changeset
672 for i in nodelist:
b4eedd2147ff gui converter: fix processing of complex list elements
Thomas Waldmann <tw@waldmann-edv.de>
parents: 559
diff changeset
673 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
674 if i.localName == 'br':
e0301e5bf019 fix gui editor line break in list problem MoinMoinBugs/GuiEditorLineBreakInLists
Byeongweon [tasyblue@gmail.com]
parents: 3992
diff changeset
675 self.text.append('<<BR>>')
e0301e5bf019 fix gui editor line break in list problem MoinMoinBugs/GuiEditorLineBreakInLists
Byeongweon [tasyblue@gmail.com]
parents: 3992
diff changeset
676 else:
e0301e5bf019 fix gui editor line break in list problem MoinMoinBugs/GuiEditorLineBreakInLists
Byeongweon [tasyblue@gmail.com]
parents: 3992
diff changeset
677 self.process_inline(i)
560
b4eedd2147ff gui converter: fix processing of complex list elements
Thomas Waldmann <tw@waldmann-edv.de>
parents: 559
diff changeset
678 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
679 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
680 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
681 del nodelist[:]
b4eedd2147ff gui converter: fix processing of complex list elements
Thomas Waldmann <tw@waldmann-edv.de>
parents: 559
diff changeset
682
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
683 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
684 found = False
560
b4eedd2147ff gui converter: fix processing of complex list elements
Thomas Waldmann <tw@waldmann-edv.de>
parents: 559
diff changeset
685 need_indent = False
b4eedd2147ff gui converter: fix processing of complex list elements
Thomas Waldmann <tw@waldmann-edv.de>
parents: 559
diff changeset
686 pending = []
4947
3695ad9d93f2 fix pep8 failures
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4943
diff changeset
687
4943
d5d9ef80d39b Fixes a bug with empty list items in the GUI editor.
Josef Meier (jo.meier@gmx.de)
parents: 4496
diff changeset
688 # If this is a empty list item, we just terminate the line
d5d9ef80d39b Fixes a bug with empty list items in the GUI editor.
Josef Meier (jo.meier@gmx.de)
parents: 4496
diff changeset
689 if node.childNodes.length == 0:
d5d9ef80d39b Fixes a bug with empty list items in the GUI editor.
Josef Meier (jo.meier@gmx.de)
parents: 4496
diff changeset
690 self.text.append(self.new_line)
d5d9ef80d39b Fixes a bug with empty list items in the GUI editor.
Josef Meier (jo.meier@gmx.de)
parents: 4496
diff changeset
691 return
4947
3695ad9d93f2 fix pep8 failures
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4943
diff changeset
692
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
693 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
694 name = i.localName
560
b4eedd2147ff gui converter: fix processing of complex list elements
Thomas Waldmann <tw@waldmann-edv.de>
parents: 559
diff changeset
695
2286
01f05e74aa9c Big PEP8 and whitespace cleanup
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1918
diff changeset
696 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
697 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
698 need_indent = True
999
97ce857bdebf whitespace-only cleanup and minor style changes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 878
diff changeset
699
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
700 if name == 'p':
560
b4eedd2147ff gui converter: fix processing of complex list elements
Thomas Waldmann <tw@waldmann-edv.de>
parents: 559
diff changeset
701 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
702 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
703 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
704 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
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 == 'pre':
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_preformatted_item(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
2286
01f05e74aa9c Big PEP8 and whitespace cleanup
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1918
diff changeset
711 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
712 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
713 found = True
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
714 elif name == 'dl':
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
715 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
716 found = True
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
717 elif name == 'table':
560
b4eedd2147ff gui converter: fix processing of complex list elements
Thomas Waldmann <tw@waldmann-edv.de>
parents: 559
diff changeset
718 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
719 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
720 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
721 found = True
3993
e0301e5bf019 fix gui editor line break in list problem MoinMoinBugs/GuiEditorLineBreakInLists
Byeongweon [tasyblue@gmail.com]
parents: 3992
diff changeset
722 elif name == 'br':
e0301e5bf019 fix gui editor line break in list problem MoinMoinBugs/GuiEditorLineBreakInLists
Byeongweon [tasyblue@gmail.com]
parents: 3992
diff changeset
723 pending.append(i)
560
b4eedd2147ff gui converter: fix processing of complex list elements
Thomas Waldmann <tw@waldmann-edv.de>
parents: 559
diff changeset
724 else:
b4eedd2147ff gui converter: fix processing of complex list elements
Thomas Waldmann <tw@waldmann-edv.de>
parents: 559
diff changeset
725 pending.append(i)
b4eedd2147ff gui converter: fix processing of complex list elements
Thomas Waldmann <tw@waldmann-edv.de>
parents: 559
diff changeset
726
b4eedd2147ff gui converter: fix processing of complex list elements
Thomas Waldmann <tw@waldmann-edv.de>
parents: 559
diff changeset
727 if found:
b4eedd2147ff gui converter: fix processing of complex list elements
Thomas Waldmann <tw@waldmann-edv.de>
parents: 559
diff changeset
728 need_indent = True
b4eedd2147ff gui converter: fix processing of complex list elements
Thomas Waldmann <tw@waldmann-edv.de>
parents: 559
diff changeset
729
b4eedd2147ff gui converter: fix processing of complex list elements
Thomas Waldmann <tw@waldmann-edv.de>
parents: 559
diff changeset
730 if pending:
b4eedd2147ff gui converter: fix processing of complex list elements
Thomas Waldmann <tw@waldmann-edv.de>
parents: 559
diff changeset
731 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
732
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
733 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
734 # 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
735 # <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
736 # <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
737 # <bq>bbbbbb
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
738 self.depth += 1
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
739 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
740 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
741 name = i.localName
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
742 if name == 'p':
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
743 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
744 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
745 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
746 elif name == 'pre':
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
747 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
748 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
749 self.process_pre(i)
2286
01f05e74aa9c Big PEP8 and whitespace cleanup
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1918
diff changeset
750 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
751 self.process_heading(i)
2286
01f05e74aa9c Big PEP8 and whitespace cleanup
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1918
diff changeset
752 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
753 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
754 elif name == 'dl':
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
755 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
756 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
757 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
758 elif name == 'img':
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
759 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
760 elif name == 'div':
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
761 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
762 elif name == 'blockquote':
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
763 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
764 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
765 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
766 elif name == 'br':
19
6772e845059d fix for gecko paste link brokenness, src cosmetics
Thomas Waldmann <tw@waldmann-edv.de>
parents: 10
diff changeset
767 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
768 else:
48
8a37de5a6b79 fixed broken tests package, moved ConvertError to convert module
Nir Soffer <nirs@freeshell.org>
parents: 37
diff changeset
769 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
770 self.depth -= 1
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
771
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
772 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
773 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
774 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
775 return
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
776
1700
c54be3afb830 gui editor converter: indenting fixes, code simplification
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1649
diff changeset
777 # 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
778 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
779 if name is None:
9b21b7907167 this should fix MoinMoinBugs/GuiEditorTypeErrorWhenSaving
Thomas Waldmann <tw@waldmann-edv.de>
parents: 275
diff changeset
780 return
428
f4d09019cbb8 fixed MoinMoinBugs/ProcessInlineDontSupportUlElement, some converter code cleanup
Thomas Waldmann <tw@waldmann-edv.de>
parents: 407
diff changeset
781
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
782 # 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
783 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
784 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
785
2286
01f05e74aa9c Big PEP8 and whitespace cleanup
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1918
diff changeset
786 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
787 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
788 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
789 return
999
97ce857bdebf whitespace-only cleanup and minor style changes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 878
diff changeset
790
97ce857bdebf whitespace-only cleanup and minor style changes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 878
diff changeset
791 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
792 if func:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
793 func(node)
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
794 return
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
795
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
796 command_close = None
2286
01f05e74aa9c Big PEP8 and whitespace cleanup
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1918
diff changeset
797 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
798 command = "''"
2286
01f05e74aa9c Big PEP8 and whitespace cleanup
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1918
diff changeset
799 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
800 command = "'''"
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
801 elif name == 'u':
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 == 'big':
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
804 command = "~+"
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
805 command_close = "+~"
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
806 elif name == 'small':
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
807 command = "~-"
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
808 command_close = "-~"
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
809 elif name == 'strike':
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
810 command = "--("
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
811 command_close = ")--"
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
812 elif name == 'sub':
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
813 command = ",,"
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
814 elif name == 'sup':
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
815 command = "^"
4117
72ac60ad99c9 text_html_text_moin_wiki.process_inline: added some more unsupported elements, bug fix for MoinMoinBugs/1.8_GUIEditorDoesNotSupportScriptElement
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 4116
diff changeset
816 elif name in ('area', 'center', 'code', 'embed', 'fieldset', 'font', 'form', 'iframe', 'input', 'label', 'link', 'map',
72ac60ad99c9 text_html_text_moin_wiki.process_inline: added some more unsupported elements, bug fix for MoinMoinBugs/1.8_GUIEditorDoesNotSupportScriptElement
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 4116
diff changeset
817 'meta', 'noscript', 'option', 'script', 'select', 'textarea', 'wbr'):
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
818 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
819 else:
48
8a37de5a6b79 fixed broken tests package, moved ConvertError to convert module
Nir Soffer <nirs@freeshell.org>
parents: 37
diff changeset
820 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
821
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
822 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
823 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
824 # 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
825 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
826 # 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
827 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
828 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
829 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
830 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
831 # 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
832 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
833 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
834 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
835 if command_close:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
836 command = command_close
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
837 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
838
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
839 def process_span(self, node):
3992
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
840 # process span tag for firefox3
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
841 node_style = node.getAttribute("style")
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
842
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
843 is_strike = node.getAttribute("class") == "strike"
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
844 is_strike = is_strike or "line-through" in node_style
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
845 is_strong = "bold" in node_style
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
846 is_italic = "italic" in node_style
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
847 is_underline = "underline" in node_style
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
848 is_comment = node.getAttribute("class") == "comment"
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 # start tag
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
851 if is_comment:
3988
be43e3973baa fix gui editor remove inline comments problem
Byeongweon [tasyblue@gmail.com]
parents: 3984
diff changeset
852 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
853 if is_strike:
3992
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
854 self.text.append("--(")
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
855 if is_strong:
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
856 self.text.append("'''")
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_underline:
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
860 self.text.append("__")
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
861
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
862 # body
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
863 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
864 self.process_inline(i)
3992
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
865
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
866 # end tag
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
867 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
868 self.text.append("__")
3992
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
869 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
870 self.text.append("''")
3992
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
871 if is_strong:
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
872 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
873 if is_strike:
3992
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
874 self.text.append(")--")
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
875 if is_comment:
3988
be43e3973baa fix gui editor remove inline comments problem
Byeongweon [tasyblue@gmail.com]
parents: 3984
diff changeset
876 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
877
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
878 def process_div(self, node):
4001
5bb18401738b fix MoinMoinBugs/GuiEditorIndentStyledText bug
Byeongweon [tasyblue@gmail.com]
parents: 3998
diff changeset
879 # process indent
5bb18401738b fix MoinMoinBugs/GuiEditorIndentStyledText bug
Byeongweon [tasyblue@gmail.com]
parents: 3998
diff changeset
880 self._process_indent(node)
5bb18401738b fix MoinMoinBugs/GuiEditorIndentStyledText bug
Byeongweon [tasyblue@gmail.com]
parents: 3998
diff changeset
881
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
882 # 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
883 for i in node.childNodes:
854
a71bcc0f27c3 fixed MoinMoinBugs:GuiEditorDeletesNewBulletText
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 834
diff changeset
884 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
885
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
886 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
887 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
888 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
889 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
890 else:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
891 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
892
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
893 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
894 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
895 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
896 else:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
897 class_ = "hr0"
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
898 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
899 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
900 else:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
901 length = 4
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
902 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
903
3992
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
904 def process_p(self, node):
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
905 # process indent
4001
5bb18401738b fix MoinMoinBugs/GuiEditorIndentStyledText bug
Byeongweon [tasyblue@gmail.com]
parents: 3998
diff changeset
906 self._process_indent(node)
5bb18401738b fix MoinMoinBugs/GuiEditorIndentStyledText bug
Byeongweon [tasyblue@gmail.com]
parents: 3998
diff changeset
907 self.process_paragraph_item(node)
5bb18401738b fix MoinMoinBugs/GuiEditorIndentStyledText bug
Byeongweon [tasyblue@gmail.com]
parents: 3998
diff changeset
908 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
909
5bb18401738b fix MoinMoinBugs/GuiEditorIndentStyledText bug
Byeongweon [tasyblue@gmail.com]
parents: 3998
diff changeset
910 def _process_indent(self, node):
5bb18401738b fix MoinMoinBugs/GuiEditorIndentStyledText bug
Byeongweon [tasyblue@gmail.com]
parents: 3998
diff changeset
911 # process indent
3992
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
912 node_style = node.getAttribute("style")
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
913 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
914 if match:
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
915 left_margin = int(match.group(1))
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
916 indent_depth = int(left_margin / 40)
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
917 if indent_depth > 0:
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
918 self.text.append(' . ')
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
919
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
920 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
921 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
922 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
923 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
924 elif i.nodeType == Node.TEXT_NODE:
559
77e2149d7eab fix gui converter html \n processing
Thomas Waldmann <tw@waldmann-edv.de>
parents: 544
diff changeset
925 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
926
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
927 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
928 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
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
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
931 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
932 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
933 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
934 else:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
935 class_ = None
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
936 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
937 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
938 if i.nodeType == Node.TEXT_NODE:
3992
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
939 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
940 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
941 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
942 else:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
943 pass
3992
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
944 else:
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
945 content_buffer = []
3990
645d031f4eab fix gui editor remove nested markup problem
Byeongweon [tasyblue@gmail.com]
parents: 3988
diff changeset
946 longest_inner_formater = ''
3996
40f10410e0b3 fix bug : MoinMoinBugs/GuiEditorDestroysParserSyntax
Byeongweon [tasyblue@gmail.com]
parents: 3993
diff changeset
947 bang_args = ''
3998
63a209dee4b3 fix delimiter process routine to handle close delimiter also. see MoinMoinBugs/GuiEditorCantNest
Byeongweon [tasyblue@gmail.com]
parents: 3997
diff changeset
948 delimiters = []
3992
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
949
4008
740e37c6ae92 fix code for PEP8
Byeongweon [tasyblue@gmail.com]
parents: 4003
diff changeset
950 """
3997
238eceaf862d add comment about prossible error
Byeongweon [tasyblue@gmail.com]
parents: 3996
diff changeset
951 below code fixed for MoinMoinBugs/GuiEditorCantNest bug
238eceaf862d add comment about prossible error
Byeongweon [tasyblue@gmail.com]
parents: 3996
diff changeset
952 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
953 e.g. {{{{{{ {{{ foo }}} }}}}}} --> {{{{ {{{ foo }}} }}}}
4009
579b76b20c8c add additional comment about MoinMoinBugs/GuiEditorCantNest bug
Byeongweon [tasyblue@gmail.com]
parents: 4008
diff changeset
954 {{{foo {{{ }}} foo}}} --> {{{{ {{{ }}} }}}}
4008
740e37c6ae92 fix code for PEP8
Byeongweon [tasyblue@gmail.com]
parents: 4003
diff changeset
955 """
3997
238eceaf862d add comment about prossible error
Byeongweon [tasyblue@gmail.com]
parents: 3996
diff changeset
956
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
957 for i in node.childNodes:
3992
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
958 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
959 # 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
960 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
961 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
962 # 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
963 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
964 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
965 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
966 for line in data_lines:
3996
40f10410e0b3 fix bug : MoinMoinBugs/GuiEditorDestroysParserSyntax
Byeongweon [tasyblue@gmail.com]
parents: 3993
diff changeset
967 if line.strip().startswith('#!'):
40f10410e0b3 fix bug : MoinMoinBugs/GuiEditorDestroysParserSyntax
Byeongweon [tasyblue@gmail.com]
parents: 3993
diff changeset
968 if bang_args == '':
40f10410e0b3 fix bug : MoinMoinBugs/GuiEditorDestroysParserSyntax
Byeongweon [tasyblue@gmail.com]
parents: 3993
diff changeset
969 bang_args = line.strip()
40f10410e0b3 fix bug : MoinMoinBugs/GuiEditorDestroysParserSyntax
Byeongweon [tasyblue@gmail.com]
parents: 3993
diff changeset
970 else:
40f10410e0b3 fix bug : MoinMoinBugs/GuiEditorDestroysParserSyntax
Byeongweon [tasyblue@gmail.com]
parents: 3993
diff changeset
971 content_buffer.extend([line, self.new_line])
40f10410e0b3 fix bug : MoinMoinBugs/GuiEditorDestroysParserSyntax
Byeongweon [tasyblue@gmail.com]
parents: 3993
diff changeset
972 else:
40f10410e0b3 fix bug : MoinMoinBugs/GuiEditorDestroysParserSyntax
Byeongweon [tasyblue@gmail.com]
parents: 3993
diff changeset
973 content_buffer.extend([line, self.new_line])
3992
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
974 elif i.localName == 'br':
3990
645d031f4eab fix gui editor remove nested markup problem
Byeongweon [tasyblue@gmail.com]
parents: 3988
diff changeset
975 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
976 else:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
977 pass
3992
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
978
3998
63a209dee4b3 fix delimiter process routine to handle close delimiter also. see MoinMoinBugs/GuiEditorCantNest
Byeongweon [tasyblue@gmail.com]
parents: 3997
diff changeset
979 if delimiters:
63a209dee4b3 fix delimiter process routine to handle close delimiter also. see MoinMoinBugs/GuiEditorCantNest
Byeongweon [tasyblue@gmail.com]
parents: 3997
diff changeset
980 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
981
3992
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
982 if (len(longest_inner_formater) >= 3):
3996
40f10410e0b3 fix bug : MoinMoinBugs/GuiEditorDestroysParserSyntax
Byeongweon [tasyblue@gmail.com]
parents: 3993
diff changeset
983 self.text.extend([("{" * (len(longest_inner_formater) + 1)) + bang_args, \
40f10410e0b3 fix bug : MoinMoinBugs/GuiEditorDestroysParserSyntax
Byeongweon [tasyblue@gmail.com]
parents: 3993
diff changeset
984 self.new_line])
3992
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
985 self.text.extend(content_buffer)
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
986 self.text.extend(["}" * (len(longest_inner_formater) + 1), \
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
987 self.new_line])
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
988 else:
3996
40f10410e0b3 fix bug : MoinMoinBugs/GuiEditorDestroysParserSyntax
Byeongweon [tasyblue@gmail.com]
parents: 3993
diff changeset
989 self.text.extend(["{{{"+bang_args, self.new_line])
3992
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
990 self.text.extend(content_buffer)
513613f25bbf fix source code with PEP8
Byeongweon [tasyblue@gmail.com]
parents: 3991
diff changeset
991 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
992
999
97ce857bdebf whitespace-only cleanup and minor style changes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 878
diff changeset
993 _alignment = {"left": "(",
97ce857bdebf whitespace-only cleanup and minor style changes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 878
diff changeset
994 "center": ":",
97ce857bdebf whitespace-only cleanup and minor style changes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 878
diff changeset
995 "right": ")",
97ce857bdebf whitespace-only cleanup and minor style changes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 878
diff changeset
996 "top": "^",
97ce857bdebf whitespace-only cleanup and minor style changes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 878
diff changeset
997 "bottom": "v"}
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
998
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
999 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
1000 try:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1001 int(value)
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1002 return value + 'px'
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1003 except ValueError:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1004 return value
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1005
4119
5d102b84ce1e gui converter: reduce code duplication
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4058
diff changeset
1006 def _get_color(self, node, prefix):
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1007 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
1008 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
1009 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
1010 if match:
4119
5d102b84ce1e gui converter: reduce code duplication
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4058
diff changeset
1011 value = '#%X%X%X' % (int(match.group(1)), int(match.group(2)), int(match.group(3)))
4121
4780e4b6e99d gui converter: create shorter output for colors
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4120
diff changeset
1012 else:
4780e4b6e99d gui converter: create shorter output for colors
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4120
diff changeset
1013 match = re.match(r"#[0-9A-Fa-f]{6}", value)
4119
5d102b84ce1e gui converter: reduce code duplication
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4058
diff changeset
1014 if not prefix and match:
5d102b84ce1e gui converter: reduce code duplication
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4058
diff changeset
1015 result = value
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1016 else:
4119
5d102b84ce1e gui converter: reduce code duplication
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4058
diff changeset
1017 result = '%sbgcolor="%s"' % (prefix, value)
5d102b84ce1e gui converter: reduce code duplication
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4058
diff changeset
1018 else:
5d102b84ce1e gui converter: reduce code duplication
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4058
diff changeset
1019 result = ''
5d102b84ce1e gui converter: reduce code duplication
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4058
diff changeset
1020 return result
5d102b84ce1e gui converter: reduce code duplication
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4058
diff changeset
1021
5d102b84ce1e gui converter: reduce code duplication
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4058
diff changeset
1022 def _table_style(self, node):
5d102b84ce1e gui converter: reduce code duplication
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4058
diff changeset
1023 # TODO: attrs = get_attrs(node)
5d102b84ce1e gui converter: reduce code duplication
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4058
diff changeset
1024 result = []
5d102b84ce1e gui converter: reduce code duplication
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4058
diff changeset
1025 result.append(self._get_color(node, 'table'))
0
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("width"):
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("width")
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1028 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
1029 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
1030 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
1031 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
1032 if node.hasAttribute("align"):
08778f685aaf begin fixing http://moinmoin.wikiwikiweb.de/MoinMoinBugs/GuiEditorDestroysTableStyles (incomplete)
Thomas Waldmann <tw@waldmann-edv.de>
parents: 276
diff changeset
1033 value = node.getAttribute("align")
08778f685aaf begin fixing http://moinmoin.wikiwikiweb.de/MoinMoinBugs/GuiEditorDestroysTableStyles (incomplete)
Thomas Waldmann <tw@waldmann-edv.de>
parents: 276
diff changeset
1034 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
1035 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
1036 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
1037 if node.hasAttribute("class"):
f6a74f85b9d7 fix tableclass attr for gui editor
Thomas Waldmann <tw@waldmann-edv.de>
parents: 488
diff changeset
1038 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
1039 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
1040
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1041 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
1042 # 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
1043 result = []
4119
5d102b84ce1e gui converter: reduce code duplication
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4058
diff changeset
1044 result.append(self._get_color(node, 'row'))
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1045 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
1046 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
1047 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
1048 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
1049 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
1050
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1051 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
1052 # 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
1053 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
1054 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
1055 else:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1056 rowspan = ""
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1057
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("colspan"):
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1059 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
1060 else:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1061 colspan = 1
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1062
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1063 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
1064
544
bdaea0dcf3b1 converter: fix table/row/cell style spaces
Thomas Waldmann <tw@waldmann-edv.de>
parents: 531
diff changeset
1065 align = ""
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1066 result = []
4119
5d102b84ce1e gui converter: reduce code duplication
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4058
diff changeset
1067 result.append(self._get_color(node, ''))
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1068 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
1069 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
1070 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
1071 # 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
1072 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
1073 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
1074 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
1075 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
1076 # 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
1077 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
1078 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
1079 value = node.getAttribute("width")
5668
e77e7448ae1f text_html_text_moin_wiki: fixed index error for a width="". (MoinMoinBugs/GUI_convertor_list_index_out_of_range)
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 5537
diff changeset
1080 if value and value[-1] == "%":
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1081 align += value
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1082 else:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1083 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
1084 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
1085 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
1086 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
1087 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
1088 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
1089 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
1090 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
1091 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
1092 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
1093
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1094 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
1095 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
1096 result.append(rowspan)
544
bdaea0dcf3b1 converter: fix table/row/cell style spaces
Thomas Waldmann <tw@waldmann-edv.de>
parents: 531
diff changeset
1097 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
1098
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1099 def process_table(self, node, style=""):
4003
9ab4430107e9 fix MoinMoinBugs/GuiEditorIndentingChangedForTables bug
Byeongweon [tasyblue@gmail.com]
parents: 4001
diff changeset
1100 if self.depth == 0:
9ab4430107e9 fix MoinMoinBugs/GuiEditorIndentingChangedForTables bug
Byeongweon [tasyblue@gmail.com]
parents: 4001
diff changeset
1101 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
1102 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
1103 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
1104 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
1105 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
1106 name = i.localName
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1107 if name == 'tr':
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1108 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
1109 style = ""
294
3cbbedfb89af converter: handle thead and tfoot tags
Thomas Waldmann <tw@waldmann-edv.de>
parents: 277
diff changeset
1110 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
1111 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
1112 elif name == 'caption':
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1113 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
1114 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
1115 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
1116 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
1117 else:
48
8a37de5a6b79 fixed broken tests package, moved ConvertError to convert module
Nir Soffer <nirs@freeshell.org>
parents: 37
diff changeset
1118 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
1119 #else:
48
8a37de5a6b79 fixed broken tests package, moved ConvertError to convert module
Nir Soffer <nirs@freeshell.org>
parents: 37
diff changeset
1120 # 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
1121 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
1122
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1123 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
1124 # get first row
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1125 for i in table.childNodes:
294
3cbbedfb89af converter: handle thead and tfoot tags
Thomas Waldmann <tw@waldmann-edv.de>
parents: 277
diff changeset
1126 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
1127 #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
1128 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
1129 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
1130 break
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1131 break
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1132 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
1133 break
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1134 # count columns
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1135 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
1136 colspan = 0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1137 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
1138 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
1139 continue
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1140 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
1141 try:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1142 colspan += int(span)
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1143 except ValueError:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1144 colspan += 1
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1145 else:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1146 colspan = 1
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1147 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
1148 if text:
4124
a6f8071cfbe1 GUI editor converter: fix processing of table caption
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4121
diff changeset
1149 if style:
a6f8071cfbe1 GUI editor converter: fix processing of table caption
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4121
diff changeset
1150 style = '<%s>' % style
a6f8071cfbe1 GUI editor converter: fix processing of table caption
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 4121
diff changeset
1151 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
1152
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1153 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
1154 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
1155 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
1156 else:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1157 colspan = 1
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1158 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
1159
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1160 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
1161 if style:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1162 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
1163
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1164 found = False
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1165 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
1166 name = i.localName
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1167 if name == 'p':
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1168 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
1169 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
1170 found = True
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1171 if not found:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
1172 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
1173 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
1174 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
1175 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 googlemai