annotate MoinMoin/formatter/text_gedit.py @ 1704:fe19c9ac4b82

text_gedit: Feature scalable images for gui added
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Sat, 06 Jan 2007 15:27:29 +0100
parents 55761640667a
children a31498666626
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 # -*- coding: iso-8859-1 -*-
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
2 """
407
bea43f99cc27 star-merged moin--refactor--1.5 (formatter, parser, converter fixes, see docs/CHANGES.refactor)
Thomas Waldmann <tw@waldmann-edv.de>
parents: 281
diff changeset
3 MoinMoin - "text/html+css" Formatter for feeding the GUI editor
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
4
1704
fe19c9ac4b82 text_gedit: Feature scalable images for gui added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1650
diff changeset
5 @copyright: (c) Bastian Blank, Florian Festi, Thomas Waldmann, Reimar Bauer
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
661
19ef5f9fff84 moved formatter.base to formatter.__init__
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 652
diff changeset
9 from MoinMoin.formatter import FormatterBase, text_html
159
74bcce9d3dae i18n code cleanup
Thomas Waldmann <tw@waldmann-edv.de>
parents: 139
diff changeset
10 from MoinMoin import wikiutil, config
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
11 from MoinMoin.Page import Page
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
12 from MoinMoin.action import AttachFile
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
13
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
14 class Formatter(text_html.Formatter):
528
92faed4fbd76 updated i18n, fix orig. text typo
Thomas Waldmann <tw@waldmann-edv.de>
parents: 410
diff changeset
15 """ Send HTML data for the GUI editor """
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
16
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
17 # Block elements ####################################################
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
18
529
20f8bda12a7b fix table *bgcolor trouble, cleanup style synth, fix html_gedit api
Thomas Waldmann <tw@waldmann-edv.de>
parents: 528
diff changeset
19 def heading(self, on, depth, **kw):
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
20 # remember depth of first heading, and adapt counting depth accordingly
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
21 if not self._base_depth:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
22 self._base_depth = depth
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
23
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
24 count_depth = max(depth - (self._base_depth - 1), 1)
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
25 heading_depth = depth + 1
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
26
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
27 # closing tag, with empty line after, to make source more readable
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
28 if not on:
407
bea43f99cc27 star-merged moin--refactor--1.5 (formatter, parser, converter fixes, see docs/CHANGES.refactor)
Thomas Waldmann <tw@waldmann-edv.de>
parents: 281
diff changeset
29 return self._close('h%d' % heading_depth)
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
30 else:
529
20f8bda12a7b fix table *bgcolor trouble, cleanup style synth, fix html_gedit api
Thomas Waldmann <tw@waldmann-edv.de>
parents: 528
diff changeset
31 return self._open('h%d' % heading_depth, **kw)
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
32
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
33 # Links ##############################################################
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
34
139
639dc94d4c52 fixed MoinMoinBugs/GUIEditorInsertsQuestionmark
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 36
diff changeset
35 def pagelink(self, on, pagename='', page=None, **kw):
639dc94d4c52 fixed MoinMoinBugs/GUIEditorInsertsQuestionmark
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 36
diff changeset
36 """ Link to a page.
639dc94d4c52 fixed MoinMoinBugs/GUIEditorInsertsQuestionmark
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 36
diff changeset
37
639dc94d4c52 fixed MoinMoinBugs/GUIEditorInsertsQuestionmark
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 36
diff changeset
38 formatter.text_python will use an optimized call with a page!=None
639dc94d4c52 fixed MoinMoinBugs/GUIEditorInsertsQuestionmark
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 36
diff changeset
39 parameter. DO NOT USE THIS YOURSELF OR IT WILL BREAK.
639dc94d4c52 fixed MoinMoinBugs/GUIEditorInsertsQuestionmark
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 36
diff changeset
40
639dc94d4c52 fixed MoinMoinBugs/GUIEditorInsertsQuestionmark
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 36
diff changeset
41 See wikiutil.link_tag() for possible keyword parameters.
639dc94d4c52 fixed MoinMoinBugs/GUIEditorInsertsQuestionmark
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 36
diff changeset
42 """
1182
5de0dc972701 removed deprecated usage of apply()
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 999
diff changeset
43 FormatterBase.pagelink(self, on, pagename, page, **kw)
139
639dc94d4c52 fixed MoinMoinBugs/GUIEditorInsertsQuestionmark
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 36
diff changeset
44 if page is None:
999
97ce857bdebf whitespace-only cleanup and minor style changes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 661
diff changeset
45 page = Page(self.request, pagename, formatter=self)
139
639dc94d4c52 fixed MoinMoinBugs/GUIEditorInsertsQuestionmark
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 36
diff changeset
46 return page.link_to(self.request, on=on, **kw)
639dc94d4c52 fixed MoinMoinBugs/GUIEditorInsertsQuestionmark
Florian Festi <Florian.Festi@trick.informatik.uni-stuttgart.de>
parents: 36
diff changeset
47
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
48 def interwikilink(self, on, interwiki='', pagename='', **kw):
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
49 """
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
50 @keyword title: override using the interwiki wikiname as title
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
51 """
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
52 if not on:
529
20f8bda12a7b fix table *bgcolor trouble, cleanup style synth, fix html_gedit api
Thomas Waldmann <tw@waldmann-edv.de>
parents: 528
diff changeset
53 return self.url(0) # return '</a>'
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
54 html_class = 'badinterwiki' # we use badinterwiki in any case to simplify reverse conversion
652
483d2c0ee1f4 fix deletion of empty interwiki links (backport to 1.5)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 639
diff changeset
55 href = wikiutil.quoteWikinameURL(pagename) or "/" # FCKeditor behaves strange on empty href
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
56 title = kw.get('title', interwiki)
410
1a2bd0457cf3 fix some wrong attributes, todo: fix quoting, see comment in text_html.url
Thomas Waldmann <tw@waldmann-edv.de>
parents: 407
diff changeset
57 return self.url(1, href, title=title, do_escape=1, css=html_class) # interwiki links with pages with umlauts
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
58
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
59 def attachment_inlined(self, url, text, **kw):
407
bea43f99cc27 star-merged moin--refactor--1.5 (formatter, parser, converter fixes, see docs/CHANGES.refactor)
Thomas Waldmann <tw@waldmann-edv.de>
parents: 281
diff changeset
60 if url == text:
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
61 return '<span style="background-color:#ffff11">inline:%s</span>' % url
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
62 else:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
63 return '<span style="background-color:#ffff11">[inline:%s %s]</span>' % (url, text)
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
64
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
65 def attachment_link(self, url, text, **kw):
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
66 _ = self.request.getText
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
67 pagename = self.page.page_name
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
68 target = AttachFile.getAttachUrl(pagename, url, self.request)
529
20f8bda12a7b fix table *bgcolor trouble, cleanup style synth, fix html_gedit api
Thomas Waldmann <tw@waldmann-edv.de>
parents: 528
diff changeset
69 return (self.url(1, target, title="attachment:%s" % wikiutil.quoteWikinameURL(url)) +
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
70 self.text(text) +
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
71 self.url(0))
999
97ce857bdebf whitespace-only cleanup and minor style changes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 661
diff changeset
72
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
73 def attachment_image(self, url, **kw):
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
74 _ = self.request.getText
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
75 pagename = self.page.page_name
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
76 return self.image(
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
77 title="attachment:%s" % wikiutil.quoteWikinameURL(url),
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
78 src=AttachFile.getAttachUrl(pagename, url, self.request, addts=1))
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
79
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
80 def attachment_drawing(self, url, text, **kw):
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
81 _ = self.request.getText
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
82 pagename = self.page.page_name
281
8155e50e94ca fixed crash with non-ASCII attachment filename
Thomas Waldmann <tw@waldmann-edv.de>
parents: 277
diff changeset
83 image = url + u'.png'
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
84 fname = wikiutil.taintfilename(image)
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
85 fpath = AttachFile.getFilename(self.request, pagename, fname)
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
86 return self.image(
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
87 title="drawing:%s" % wikiutil.quoteWikinameURL(url),
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
88 src=AttachFile.getAttachUrl(pagename, image, self.request, addts=1))
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
89
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
90 def nowikiword(self, text):
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
91 return '<span style="background-color:#ffff11">!</span>' + self.text(text)
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
92
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
93 # Dynamic stuff / Plugins ############################################
999
97ce857bdebf whitespace-only cleanup and minor style changes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 661
diff changeset
94
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
95 def macro(self, macro_obj, name, args):
1704
fe19c9ac4b82 text_gedit: Feature scalable images for gui added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1650
diff changeset
96 #use ImageLink for resized images
fe19c9ac4b82 text_gedit: Feature scalable images for gui added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1650
diff changeset
97 if name == "ImageLink" and args is not None:
fe19c9ac4b82 text_gedit: Feature scalable images for gui added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1650
diff changeset
98 pagename = self.page.page_name
fe19c9ac4b82 text_gedit: Feature scalable images for gui added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1650
diff changeset
99 if args:
fe19c9ac4b82 text_gedit: Feature scalable images for gui added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1650
diff changeset
100 args = args.split(',')
fe19c9ac4b82 text_gedit: Feature scalable images for gui added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1650
diff changeset
101 args = [arg.strip() for arg in args]
fe19c9ac4b82 text_gedit: Feature scalable images for gui added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1650
diff changeset
102 else:
fe19c9ac4b82 text_gedit: Feature scalable images for gui added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1650
diff changeset
103 args = []
fe19c9ac4b82 text_gedit: Feature scalable images for gui added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1650
diff changeset
104 argc = len(args)
fe19c9ac4b82 text_gedit: Feature scalable images for gui added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1650
diff changeset
105 url = args[0]
fe19c9ac4b82 text_gedit: Feature scalable images for gui added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1650
diff changeset
106 keywords = {}
fe19c9ac4b82 text_gedit: Feature scalable images for gui added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1650
diff changeset
107 width = None
fe19c9ac4b82 text_gedit: Feature scalable images for gui added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1650
diff changeset
108 height = None
fe19c9ac4b82 text_gedit: Feature scalable images for gui added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1650
diff changeset
109 alt = None
fe19c9ac4b82 text_gedit: Feature scalable images for gui added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1650
diff changeset
110 for arg in args:
fe19c9ac4b82 text_gedit: Feature scalable images for gui added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1650
diff changeset
111 if arg.find('=') > -1:
fe19c9ac4b82 text_gedit: Feature scalable images for gui added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1650
diff changeset
112 key, value = arg.split('=')
fe19c9ac4b82 text_gedit: Feature scalable images for gui added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1650
diff changeset
113 if key == 'width':
fe19c9ac4b82 text_gedit: Feature scalable images for gui added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1650
diff changeset
114 width = value
fe19c9ac4b82 text_gedit: Feature scalable images for gui added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1650
diff changeset
115 if key == 'height':
fe19c9ac4b82 text_gedit: Feature scalable images for gui added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1650
diff changeset
116 height = value
fe19c9ac4b82 text_gedit: Feature scalable images for gui added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1650
diff changeset
117 if key == 'alt':
fe19c9ac4b82 text_gedit: Feature scalable images for gui added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1650
diff changeset
118 alt = value
fe19c9ac4b82 text_gedit: Feature scalable images for gui added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1650
diff changeset
119 target = None
fe19c9ac4b82 text_gedit: Feature scalable images for gui added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1650
diff changeset
120 if argc >= 2 and args[1]:
fe19c9ac4b82 text_gedit: Feature scalable images for gui added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1650
diff changeset
121 target = args[1]
fe19c9ac4b82 text_gedit: Feature scalable images for gui added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1650
diff changeset
122
fe19c9ac4b82 text_gedit: Feature scalable images for gui added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1650
diff changeset
123 return self.image(
fe19c9ac4b82 text_gedit: Feature scalable images for gui added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1650
diff changeset
124 title="attachment:%s" % wikiutil.quoteWikinameURL(url),
fe19c9ac4b82 text_gedit: Feature scalable images for gui added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1650
diff changeset
125 src=AttachFile.getAttachUrl(pagename, url, self.request, addts=1), width=width, height=height, alt=alt, target=target)
fe19c9ac4b82 text_gedit: Feature scalable images for gui added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1650
diff changeset
126
fe19c9ac4b82 text_gedit: Feature scalable images for gui added
Reimar Bauer <rb.proj AT googlemail DOT com>
parents: 1650
diff changeset
127 elif args is not None:
999
97ce857bdebf whitespace-only cleanup and minor style changes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 661
diff changeset
128 result = "[[%s(%s)]]" % (name, args)
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
129 else:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
130 result = "[[%s]]" % name
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
131 return '<span style="background-color:#ffff11">%s</span>' % result
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
132
639
a80a6c629bc3 remove processor support, use a parser now
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 573
diff changeset
133 def parser(self, parser_name, lines):
a80a6c629bc3 remove processor support, use a parser now
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 573
diff changeset
134 """ parser_name MUST be valid!
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
135 """
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
136 result = [self.preformatted(1)]
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
137 for line in lines:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
138 result.append(self.text(line))
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
139 result.append(self.linebreak(preformatted=1))
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
140 result.append(self.preformatted(0))
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
141
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
142 return "".join(result)
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
143
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
144 # Other ##############################################################
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
145
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
146 style2attribute = {
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
147 'width': 'width',
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
148 'height': 'height',
407
bea43f99cc27 star-merged moin--refactor--1.5 (formatter, parser, converter fixes, see docs/CHANGES.refactor)
Thomas Waldmann <tw@waldmann-edv.de>
parents: 281
diff changeset
149 'background': 'bgcolor',
bea43f99cc27 star-merged moin--refactor--1.5 (formatter, parser, converter fixes, see docs/CHANGES.refactor)
Thomas Waldmann <tw@waldmann-edv.de>
parents: 281
diff changeset
150 'background-color': 'bgcolor',
277
08778f685aaf begin fixing http://moinmoin.wikiwikiweb.de/MoinMoinBugs/GuiEditorDestroysTableStyles (incomplete)
Thomas Waldmann <tw@waldmann-edv.de>
parents: 159
diff changeset
151 #if this is used as table style="text-align: right", it doesn't work
08778f685aaf begin fixing http://moinmoin.wikiwikiweb.de/MoinMoinBugs/GuiEditorDestroysTableStyles (incomplete)
Thomas Waldmann <tw@waldmann-edv.de>
parents: 159
diff changeset
152 #if it is transformed to align="right":
407
bea43f99cc27 star-merged moin--refactor--1.5 (formatter, parser, converter fixes, see docs/CHANGES.refactor)
Thomas Waldmann <tw@waldmann-edv.de>
parents: 281
diff changeset
153 #'text-align': 'align',
bea43f99cc27 star-merged moin--refactor--1.5 (formatter, parser, converter fixes, see docs/CHANGES.refactor)
Thomas Waldmann <tw@waldmann-edv.de>
parents: 281
diff changeset
154 #'vertical-align': 'valign'
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
155 }
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
156
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
157 def _style_to_attributes(self, attrs):
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
158 if not attrs.has_key('style'):
531
f6a74f85b9d7 fix tableclass attr for gui editor
Thomas Waldmann <tw@waldmann-edv.de>
parents: 530
diff changeset
159 return attrs
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
160 unknown = []
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
161 for entry in attrs['style'].split(';'):
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
162 try:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
163 key, value = entry.split(':')
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
164 except ValueError:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
165 unknown.append(entry)
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
166 continue
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
167 key, value = key.strip(), value.strip()
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
168 if self.style2attribute.has_key(key):
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
169 attrs[self.style2attribute[key]] = value
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
170 else:
277
08778f685aaf begin fixing http://moinmoin.wikiwikiweb.de/MoinMoinBugs/GuiEditorDestroysTableStyles (incomplete)
Thomas Waldmann <tw@waldmann-edv.de>
parents: 159
diff changeset
171 unknown.append("%s:%s" % (key, value))
08778f685aaf begin fixing http://moinmoin.wikiwikiweb.de/MoinMoinBugs/GuiEditorDestroysTableStyles (incomplete)
Thomas Waldmann <tw@waldmann-edv.de>
parents: 159
diff changeset
172 if unknown:
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
173 attrs['style'] = ';'.join(unknown)
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
174 else:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
175 del attrs['style']
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
176 return attrs
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
177
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
178 def _checkTableAttr(self, attrs, prefix):
531
f6a74f85b9d7 fix tableclass attr for gui editor
Thomas Waldmann <tw@waldmann-edv.de>
parents: 530
diff changeset
179 #self.request.log(repr(attrs))
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
180 attrs = text_html.Formatter._checkTableAttr(self, attrs, prefix)
531
f6a74f85b9d7 fix tableclass attr for gui editor
Thomas Waldmann <tw@waldmann-edv.de>
parents: 530
diff changeset
181 #self.request.log(repr(attrs))
f6a74f85b9d7 fix tableclass attr for gui editor
Thomas Waldmann <tw@waldmann-edv.de>
parents: 530
diff changeset
182 attrs = self._style_to_attributes(attrs)
f6a74f85b9d7 fix tableclass attr for gui editor
Thomas Waldmann <tw@waldmann-edv.de>
parents: 530
diff changeset
183 #self.request.log(repr(attrs))
f6a74f85b9d7 fix tableclass attr for gui editor
Thomas Waldmann <tw@waldmann-edv.de>
parents: 530
diff changeset
184 return attrs
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
185
529
20f8bda12a7b fix table *bgcolor trouble, cleanup style synth, fix html_gedit api
Thomas Waldmann <tw@waldmann-edv.de>
parents: 528
diff changeset
186 _allowed_table_attrs = {
573
b6af162cc4e2 fixed gui editor formatter table height attribute
Thomas Waldmann <tw@waldmann-edv.de>
parents: 545
diff changeset
187 'table': ['class', 'id', 'style', 'bgcolor', 'width', 'height', ],
b6af162cc4e2 fixed gui editor formatter table height attribute
Thomas Waldmann <tw@waldmann-edv.de>
parents: 545
diff changeset
188 'row': ['class', 'id', 'style', 'bgcolor', 'width', 'height', ],
1650
55761640667a formatter gedit_html: allow height for table cells
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1641
diff changeset
189 '': ['colspan', 'rowspan', 'class', 'id', 'style', 'bgcolor', 'width', 'height', ],
529
20f8bda12a7b fix table *bgcolor trouble, cleanup style synth, fix html_gedit api
Thomas Waldmann <tw@waldmann-edv.de>
parents: 528
diff changeset
190 }
20f8bda12a7b fix table *bgcolor trouble, cleanup style synth, fix html_gedit api
Thomas Waldmann <tw@waldmann-edv.de>
parents: 528
diff changeset
191
407
bea43f99cc27 star-merged moin--refactor--1.5 (formatter, parser, converter fixes, see docs/CHANGES.refactor)
Thomas Waldmann <tw@waldmann-edv.de>
parents: 281
diff changeset
192 def table(self, on, attrs=None, **kw):
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
193 """ Create table
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
194
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
195 @param on: start table
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
196 @param attrs: table attributes
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
197 @rtype: string
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
198 @return start or end tag of a table
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
199 """
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
200 result = []
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
201 if on:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
202 # Open table
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
203 if not attrs:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
204 attrs = {}
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
205 else:
277
08778f685aaf begin fixing http://moinmoin.wikiwikiweb.de/MoinMoinBugs/GuiEditorDestroysTableStyles (incomplete)
Thomas Waldmann <tw@waldmann-edv.de>
parents: 159
diff changeset
206 #result.append(self.rawHTML("<!-- ATTRS1: %s -->" % repr(attrs)))
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
207 attrs = self._checkTableAttr(attrs, 'table')
277
08778f685aaf begin fixing http://moinmoin.wikiwikiweb.de/MoinMoinBugs/GuiEditorDestroysTableStyles (incomplete)
Thomas Waldmann <tw@waldmann-edv.de>
parents: 159
diff changeset
208 #result.append(self.rawHTML("<!-- ATTRS2: %s -->" % repr(attrs)))
529
20f8bda12a7b fix table *bgcolor trouble, cleanup style synth, fix html_gedit api
Thomas Waldmann <tw@waldmann-edv.de>
parents: 528
diff changeset
209 result.append(self._open('table', newline=1, attr=attrs,
20f8bda12a7b fix table *bgcolor trouble, cleanup style synth, fix html_gedit api
Thomas Waldmann <tw@waldmann-edv.de>
parents: 528
diff changeset
210 allowed_attrs=self._allowed_table_attrs['table'],
20f8bda12a7b fix table *bgcolor trouble, cleanup style synth, fix html_gedit api
Thomas Waldmann <tw@waldmann-edv.de>
parents: 528
diff changeset
211 **kw))
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
212 else:
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
213 # Close table then div
407
bea43f99cc27 star-merged moin--refactor--1.5 (formatter, parser, converter fixes, see docs/CHANGES.refactor)
Thomas Waldmann <tw@waldmann-edv.de>
parents: 281
diff changeset
214 result.append(self._close('table'))
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
215
999
97ce857bdebf whitespace-only cleanup and minor style changes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 661
diff changeset
216 return ''.join(result)
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
217
407
bea43f99cc27 star-merged moin--refactor--1.5 (formatter, parser, converter fixes, see docs/CHANGES.refactor)
Thomas Waldmann <tw@waldmann-edv.de>
parents: 281
diff changeset
218 def comment(self, text, **kw):
20
329b6aaf3118 fix for growing amounts of space before EOL in comments when using gui editor
Thomas Waldmann <tw@waldmann-edv.de>
parents: 0
diff changeset
219 text = text.rstrip() # workaround for growing amount of blanks at EOL
1641
39ca0331843f GUI editor formatter: use the formatter for comment texts (ported from 1.5)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1182
diff changeset
220 return self.preformatted(1, css_class='comment') + self.text(text) + self.preformatted(0)
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
221
407
bea43f99cc27 star-merged moin--refactor--1.5 (formatter, parser, converter fixes, see docs/CHANGES.refactor)
Thomas Waldmann <tw@waldmann-edv.de>
parents: 281
diff changeset
222 def strong(self, on, **kw):
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
223 tag = 'b'
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
224 if on:
529
20f8bda12a7b fix table *bgcolor trouble, cleanup style synth, fix html_gedit api
Thomas Waldmann <tw@waldmann-edv.de>
parents: 528
diff changeset
225 return self._open(tag, allowed_attrs=[], **kw)
407
bea43f99cc27 star-merged moin--refactor--1.5 (formatter, parser, converter fixes, see docs/CHANGES.refactor)
Thomas Waldmann <tw@waldmann-edv.de>
parents: 281
diff changeset
226 return self._close(tag)
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
227
407
bea43f99cc27 star-merged moin--refactor--1.5 (formatter, parser, converter fixes, see docs/CHANGES.refactor)
Thomas Waldmann <tw@waldmann-edv.de>
parents: 281
diff changeset
228 def emphasis(self, on, **kw):
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
229 tag = 'i'
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
230 if on:
529
20f8bda12a7b fix table *bgcolor trouble, cleanup style synth, fix html_gedit api
Thomas Waldmann <tw@waldmann-edv.de>
parents: 528
diff changeset
231 return self._open(tag, allowed_attrs=[], **kw)
407
bea43f99cc27 star-merged moin--refactor--1.5 (formatter, parser, converter fixes, see docs/CHANGES.refactor)
Thomas Waldmann <tw@waldmann-edv.de>
parents: 281
diff changeset
232 return self._close(tag)
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
233
529
20f8bda12a7b fix table *bgcolor trouble, cleanup style synth, fix html_gedit api
Thomas Waldmann <tw@waldmann-edv.de>
parents: 528
diff changeset
234 def underline(self, on, **kw):
20f8bda12a7b fix table *bgcolor trouble, cleanup style synth, fix html_gedit api
Thomas Waldmann <tw@waldmann-edv.de>
parents: 528
diff changeset
235 tag = 'u'
0
77665d8e2254 tag of nonpublic@localhost--archive/moin--enterprise--1.5--base-0
Thomas Waldmann <tw-public@gmx.de>
parents:
diff changeset
236 if on:
529
20f8bda12a7b fix table *bgcolor trouble, cleanup style synth, fix html_gedit api
Thomas Waldmann <tw@waldmann-edv.de>
parents: 528
diff changeset
237 return self._open(tag, allowed_attrs=[], **kw)
407
bea43f99cc27 star-merged moin--refactor--1.5 (formatter, parser, converter fixes, see docs/CHANGES.refactor)
Thomas Waldmann <tw@waldmann-edv.de>
parents: 281
diff changeset
238 return self._close(tag)
999
97ce857bdebf whitespace-only cleanup and minor style changes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 661
diff changeset
239
36
eb3b18ffb28b fixed some english strings, better converter debugging msgs, move lineno anchors to formatter
Thomas Waldmann <tw@waldmann-edv.de>
parents: 34
diff changeset
240 def line_anchordef(self, lineno):
eb3b18ffb28b fixed some english strings, better converter debugging msgs, move lineno anchors to formatter
Thomas Waldmann <tw@waldmann-edv.de>
parents: 34
diff changeset
241 return '' # not needed for gui editor feeding
999
97ce857bdebf whitespace-only cleanup and minor style changes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 661
diff changeset
242
36
eb3b18ffb28b fixed some english strings, better converter debugging msgs, move lineno anchors to formatter
Thomas Waldmann <tw@waldmann-edv.de>
parents: 34
diff changeset
243 def line_anchorlink(self, on, lineno=0):
eb3b18ffb28b fixed some english strings, better converter debugging msgs, move lineno anchors to formatter
Thomas Waldmann <tw@waldmann-edv.de>
parents: 34
diff changeset
244 return '' # not needed for gui editor feeding
eb3b18ffb28b fixed some english strings, better converter debugging msgs, move lineno anchors to formatter
Thomas Waldmann <tw@waldmann-edv.de>
parents: 34
diff changeset
245