Index: jrst2/src/java/org/codelutin/jrst/ReStructuredText.java diff -u jrst2/src/java/org/codelutin/jrst/ReStructuredText.java:1.13 jrst2/src/java/org/codelutin/jrst/ReStructuredText.java:1.14 --- jrst2/src/java/org/codelutin/jrst/ReStructuredText.java:1.13 Thu May 24 09:58:45 2007 +++ jrst2/src/java/org/codelutin/jrst/ReStructuredText.java Thu May 24 15:03:17 2007 @@ -23,9 +23,9 @@ * Created: 27 oct. 06 11:10:30 * * @author poussin - * @version $Revision: 1.13 $ + * @version $Revision: 1.14 $ * - * Last update: $Date: 2007/05/24 09:58:45 $ + * Last update: $Date: 2007/05/24 15:03:17 $ * by : $Author: sletellier $ */ @@ -196,7 +196,7 @@ public static final Pattern REGEX_INLINE = Pattern.compile("(.*?)"); public static final Pattern REGEX_PROBLEMATIC = Pattern.compile("(.*?)"); public static final Pattern REGEX_GENERATED = Pattern.compile("(.*?)"); - public static final Pattern REGEX_HYPERLINK_REFERENCE = Pattern.compile("(\\`[^_<>]+\\`_\\W)|('[^_<>]+'_\\W)|([\\S]+[^\\s<>\\.]+_\\W)"); + public static final Pattern REGEX_HYPERLINK_REFERENCE = Pattern.compile("(\\`[^_<>]+\\`_\\W)|('[^_<>]+'_(\\W|$))|([\\S]+[^\\s<>\\.]+_(\\W|$))"); public static final Pattern REGEX_ANONYMOUS_HYPERLINK_REFERENCE = Pattern.compile("(\\`[^<>`]+\\`__)|([\\w]+[^`\\s<>]+__)"); } Index: jrst2/src/java/org/codelutin/jrst/JRSTReader.java diff -u jrst2/src/java/org/codelutin/jrst/JRSTReader.java:1.29 jrst2/src/java/org/codelutin/jrst/JRSTReader.java:1.30 --- jrst2/src/java/org/codelutin/jrst/JRSTReader.java:1.29 Thu May 24 09:58:45 2007 +++ jrst2/src/java/org/codelutin/jrst/JRSTReader.java Thu May 24 15:03:17 2007 @@ -23,9 +23,9 @@ * Created: 27 oct. 06 00:15:34 * * @author poussin - * @version $Revision: 1.29 $ + * @version $Revision: 1.30 $ * - * Last update: $Date: 2007/05/24 09:58:45 $ + * Last update: $Date: 2007/05/24 15:03:17 $ * by : $Author: sletellier $ */ @@ -1042,8 +1042,12 @@ .setText(e.attributeValue(OPTION_ARGUMENT)); } } - optionListItem.addElement(DESCRIPTION).addAttribute("inline", - "true").setText(item.getText()); + Element description = optionListItem.addElement(DESCRIPTION); + JRSTReader reader = new JRSTReader(); + String text = item.getText(); + Document doc = reader.read(new StringReader(text)); + description.appendContent(doc.getRootElement()); + item = lexer.peekOption(); } return result; Index: jrst2/src/java/org/codelutin/jrst/JRSTLexer.java diff -u jrst2/src/java/org/codelutin/jrst/JRSTLexer.java:1.25 jrst2/src/java/org/codelutin/jrst/JRSTLexer.java:1.26 --- jrst2/src/java/org/codelutin/jrst/JRSTLexer.java:1.25 Thu May 24 09:58:45 2007 +++ jrst2/src/java/org/codelutin/jrst/JRSTLexer.java Thu May 24 15:03:17 2007 @@ -23,9 +23,9 @@ * Created: 28 oct. 06 00:44:20 * * @author poussin - * @version $Revision: 1.25 $ + * @version $Revision: 1.26 $ * - * Last update: $Date: 2007/05/24 09:58:45 $ + * Last update: $Date: 2007/05/24 15:03:17 $ * by : $Author: sletellier $ */ @@ -1082,13 +1082,15 @@ para = para.substring(level) + "\n"; // it's literal block until level is down - String [] lines = in.readWhile("^ {"+level+"}.*"); + String [] lines = in.readWhile("(^ {"+level+"}.*|\\s*)"); while (lines.length > 0) { for (String line : lines) { - para += line.substring(level) + "\n"; + if (!line.matches("\\s*")) + para += line.substring(level) + "\n"; + else + para += "\n"; } - in.skipBlankLines(); - lines = in.readWhile("^ {"+level+"}.*"); + lines = in.readWhile("(^ {"+level+"}.*|\\s*)"); } result = DocumentHelper.createElement(LITERAL_BLOCK)