Index: jrst2/src/java/org/codelutin/jrst/ReStructuredText.java diff -u jrst2/src/java/org/codelutin/jrst/ReStructuredText.java:1.6 jrst2/src/java/org/codelutin/jrst/ReStructuredText.java:1.7 --- jrst2/src/java/org/codelutin/jrst/ReStructuredText.java:1.6 Fri May 4 16:23:28 2007 +++ jrst2/src/java/org/codelutin/jrst/ReStructuredText.java Wed May 9 08:36:15 2007 @@ -23,9 +23,9 @@ * Created: 27 oct. 06 11:10:30 * * @author poussin - * @version $Revision: 1.6 $ + * @version $Revision: 1.7 $ * - * Last update: $Date: 2007/05/04 16:23:28 $ + * Last update: $Date: 2007/05/09 08:36:15 $ * by : $Author: sletellier $ */ @@ -48,7 +48,7 @@ public static final String BULLET_CHAR = "*" + "+" + "-" + "\u2022" + "\u2023" + "\u2043"; public static final String DOCINFO_ITEM = "author|authors|organization|address|contact|version|revision|status|date|copyright"; - public static final String FOOTNOTE_SYMBOL = "*†‡§¶#♠♥♦♣"; + public static final String FOOTNOTE_SYMBOL = "\u002A"+"\u2020"+"\u2021"+"\u00A7"+"\u00B6"+"\u0023"+"\u2660"+"\u2665"+"\u2666"+"\u2663"; // public static final String ADMONITION = "admonition|caution|danger|error|hint|important|note|tip|warning"; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Root Element @@ -179,7 +179,7 @@ //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Inline Elements Regex //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - public static final Pattern REGEX_EMPHASIS = Pattern.compile("\\*([^*].+?)\\*"); + public static final Pattern REGEX_EMPHASIS = Pattern.compile("\\*([^*(\\]_.+\\[)].+?)\\*"); public static final Pattern REGEX_STRONG = Pattern.compile("\\*\\*(.+?)\\*\\*"); public static final Pattern REGEX_LITERAL = Pattern.compile("``(.+?)``"); public static final Pattern REGEX_REFERENCE = Pattern.compile("(http://[-/%#&\\._\\w]+)([^-/%#&\\._\\w]|$)"); Index: jrst2/src/java/org/codelutin/jrst/JRSTReader.java diff -u jrst2/src/java/org/codelutin/jrst/JRSTReader.java:1.17 jrst2/src/java/org/codelutin/jrst/JRSTReader.java:1.18 --- jrst2/src/java/org/codelutin/jrst/JRSTReader.java:1.17 Fri May 4 16:23:28 2007 +++ jrst2/src/java/org/codelutin/jrst/JRSTReader.java Wed May 9 08:36:15 2007 @@ -23,9 +23,9 @@ * Created: 27 oct. 06 00:15:34 * * @author poussin - * @version $Revision: 1.17 $ + * @version $Revision: 1.18 $ * - * Last update: $Date: 2007/05/04 16:23:28 $ + * Last update: $Date: 2007/05/09 08:36:15 $ * by : $Author: sletellier $ */ @@ -704,13 +704,14 @@ name = label; } if (type.equals("autoSymbol")){ - symbolMax++; + int nb = Math.abs(symbolMax/10)+1; char symbol = FOOTNOTE_SYMBOL.charAt(symbolMax%10); label=""; for (int j=0;j"+matcher.group(1)+""; + Element ref = DocumentHelper.createElement(REFERENCE); + ref.addAttribute("refuri", matcher.group(2)); + ref.setText(matcher.group(1)); String key = "inlineReference" + index++; - temporaries.put(key, reference); + temporaries.put(key, ref.asXML()); text = text.substring(0, start) + "``" + key + "``" + text.substring(end); } - matcher = REGEX_FOOTNOTE_REFERENCE.matcher(text); - while (matcher.find()){ - String txtDebut=text.substring(0,matcher.start()); - String txtFin=text.substring(matcher.end(),text.length()); - Element footnote = DocumentHelper.createElement(FOOTNOTE_REFERENCE); - String sFootnote = matcher.group(); - boolean done = false; - for (int i=0;i$1"); text = REGEX_EMPHASIS.matcher(text).replaceAll("<"+EMPHASIS+">$1"); text = REGEX_REFERENCE.matcher(text).replaceAll("<"+REFERENCE+" refuri='$1'>$1$2"); - + - + matcher = REGEX_FOOTNOTE_REFERENCE.matcher(text); + index = 0; + while (matcher.find()){ + String txtDebut=text.substring(0,matcher.start()); + String txtFin=text.substring(matcher.end(),text.length()); + Element footnote = DocumentHelper.createElement(FOOTNOTE_REFERENCE); + String sFootnote = matcher.group(); + boolean done = false; + for (int i=0;i"+text+"").getRootElement(); e.setText("");