Author: sjur
Date: Fri Jan 18 09:54:19 2013
New Revision: 1435063
URL: http://svn.apache.org/viewvc?rev=1435063&view=rev
Log:
A number of changes:
* Added support for definition list constructs (;Term:definition).
* Fixed numerous spacing bugs: extra or missing spaces after inline elements.
* Improved support for inline formatting and breaks, especially in tables.
* Fixed processing of no-link constructs: [[text] should be
rendered as [text], earlier it was rendered as [[text].
The plugin should now support all relevant jspwiki markup.
As part of the changes, I also added whitespace to the grammar and the xsl, to make them more readable. I also added comments to the xsl.
Modified:
forrest/trunk/plugins/org.apache.forrest.plugin.input.wiki/resources/chaperon/grammars/wiki.grm
forrest/trunk/plugins/org.apache.forrest.plugin.input.wiki/resources/chaperon/stylesheets/wiki2xdoc.xsl
forrest/trunk/plugins/org.apache.forrest.plugin.input.wiki/status.xml
Modified: forrest/trunk/plugins/org.apache.forrest.plugin.input.wiki/resources/chaperon/grammars/wiki.grm
URL: http://svn.apache.org/viewvc/forrest/trunk/plugins/org.apache.forrest.plugin.input.wiki/resources/chaperon/grammars/wiki.grm?rev=1435063&r1=1435062&r2=1435063&view=diff
==============================================================================
--- forrest/trunk/plugins/org.apache.forrest.plugin.input.wiki/resources/chaperon/grammars/wiki.grm (original)
+++ forrest/trunk/plugins/org.apache.forrest.plugin.input.wiki/resources/chaperon/grammars/wiki.grm Fri Jan 18 09:54:19 2013
@@ -33,19 +33,30 @@
%token source "\{\{\{ (\}{0,2}[^\}])* \}\}\}";
+%token text "([^\ \t\n\r\[\{\}\|\*\\\-_!#';:]
+ | _[^_\n\r]
+ | \{[^\{\n\r]
+ | \}[^\}\n\r]
+ | '[^'\n\r]
+ | \[\[
+ | \\[^\\\n\r]
+ | \-{1,3}[^\-\n\r]?)
+ ([^ \n\r\[\{\}\|\\\-_':]
+ | _[^_\n\r]
+ | \{[^\{\n\r]
+ | \}[^\}\n\r]
+ | '[^'\n\r]
+ | \[\[
+ | \\[^\\\n\r]
+ | \-{1,3}[^\-\n\r]?
+ | \|[^\|\ \t])*";
+
%token anchor "\[( [^\[\|\]]* \| )? # [^\[\|\]]* \]";
%token link "\[( [^\[\|\]]* \| )? [^\[\|\]]* \]";
-%token text "([^\ \t\n\r\[\{\}\|\*\\\-_!#'] | _[^_\n\r] | \{[^\{\n\r] | \}[^\}\n\r] | '[^'\n\r]
- | \[\[ | \\[^\\\n\r] | \-{1,3}[^\-\n\r]?)
- ([^ \n\r\[\{\}\|\\\-_'] | _[^_\n\r] | \{[^\{\n\r] | \}[^\}\n\r] | '[^'\n\r]
- | \[\[ | \\[^\\\n\r] | \-{1,3}[^\-\n\r]? | \|[^\|\ \t])*";
-
-%right softbreak "\r(\n?) | \n";
-
-%right break "\\\\";
-
+%right break "\\\\";
+%right softbreak "\r(\n?) | \n";
%right hardbreak "(\r(\n?) | \n) ([\ \t]* (\r(\n?) | \n))+";
%token bulleted1item "\*";
@@ -56,6 +67,9 @@
%token numbered2item "##";
%token numbered3item "###";
+%right deftermstart "\;";
+%token deftermdefstart "\:";
+
%ignore "[\ \t]+";
%start document;
@@ -143,6 +157,7 @@ paragraphs
paragraph
: bulletedlist1
| numberedlist1
+ | deflist
| textsequence
| line
| source %prec softbreak
@@ -240,24 +255,45 @@ tablecolumns
;
tablecolumn
- : tablecolumnitem textblock
+ : tablecolumnitem limitedtextsequence
;
-textsequence
- : textsequence textblock softbreak
- | textsequence textblock
+limitedtextsequence
+ : textblock break limitedtextsequence
+ | textblock limitedtextsequence
+ | textblock
+ ;
+
+textsequence
+ : textblock textsequence softbreak
+ | textblock textsequence
| textblock softbreak
| textblock
- | textsequence textblock break
- | textblock break
;
textblock
: link
| anchor
- | strongblock
- | emblock
- | text
+ | strongblock
+ | emblock
+ | text
+ | codeblock
+ | deftermdefstart
+ | break
+ ;
+
+termtextsequence
+ : termtextblock break termtextsequence
+ | termtextblock termtextsequence
+ | termtextblock
+ ;
+
+termtextblock
+ : link
+ | anchor
+ | strongblock
+ | emblock
+ | text
| codeblock
;
@@ -273,8 +309,22 @@ codeblock
: codeopenitem text codecloseitem
;
-/*
-deflistblock
- : defliststart text deflistnext
+deflist
+ : defentry deflist %prec PLUS
+ | defentry
+ ;
+
+defentry
+ : deflistterm deflistdef
+ ;
+
+deflistterm
+ : deftermstart termtextsequence
+ | deftermstart
+ ;
+
+deflistdef
+ : deftermdefstart textsequence
+ | deftermdefstart softbreak
+ | deftermdefstart
;
-*/
Modified: forrest/trunk/plugins/org.apache.forrest.plugin.input.wiki/resources/chaperon/stylesheets/wiki2xdoc.xsl
URL: http://svn.apache.org/viewvc/forrest/trunk/plugins/org.apache.forrest.plugin.input.wiki/resources/chaperon/stylesheets/wiki2xdoc.xsl?rev=1435063&r1=1435062&r2=1435063&view=diff
==============================================================================
--- forrest/trunk/plugins/org.apache.forrest.plugin.input.wiki/resources/chaperon/stylesheets/wiki2xdoc.xsl (original)
+++ forrest/trunk/plugins/org.apache.forrest.plugin.input.wiki/resources/chaperon/stylesheets/wiki2xdoc.xsl Fri Jan 18 09:54:19 2013
@@ -20,12 +20,13 @@
xmlns:st="http://chaperon.sourceforge.net/schema/syntaxtree/2.0"
exclude-result-prefixes="st">
+
(ABCDEFGHIJKLMNOPQRSTUVWXYZ
@@ -62,6 +63,45 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+