Index: main/java/org/nuiton/jrst/JRSTLexer.java =================================================================== --- main/java/org/nuiton/jrst/JRSTLexer.java (revision 556) +++ main/java/org/nuiton/jrst/JRSTLexer.java (working copy) @@ -638,12 +638,12 @@ Element result = null; String line = in.readLine(); if (line != null) { - if (line.matches("^(\\s*((--?)|(//?))\\w+([ =][<]*)?)\\s*.*$")) { + if (line.matches("^(\\s*((--?)|(//?))\\w+([ =][<]*)?)\\s*.*$")) { result = DocumentHelper.createElement(OPTION_LIST) .addAttribute("level", "" + level(line)); char delimiter; do { - Matcher matcher = Pattern.compile("[-/][-/]?.+").matcher(line); + Matcher matcher = Pattern.compile("[-/][-/]?.+").matcher(line); matcher.find(); Element option = result.addElement("option"); String option_stringTmp = matcher.group(); @@ -651,32 +651,40 @@ matcher.find(); String option_string = matcher.group(); option.addAttribute("option_string", option_string); - delimiter = option_stringTmp.charAt(matcher.end()); - option_stringTmp = option_stringTmp.substring( - matcher.end(), option_stringTmp.length()); - option.addAttribute("delimiterExiste", "false"); boolean done = false; + + // Delimiteur bidon + delimiter = '.'; + if (option_stringTmp.length() > matcher.end()) { + delimiter = option_stringTmp.charAt(matcher.end()); + option_stringTmp = option_stringTmp.substring( + matcher.end(), option_stringTmp.length()); + } else { + done = true; + } + option.addAttribute("delimiterExiste", "false"); + if (delimiter == ' ') { // S'il y a 2 espaces a suivre, // l'option est finie if (option_stringTmp.charAt(1) == ' ') { done = true; } } + String option_argument = null; if ((delimiter == '=' || delimiter == ' ') && !done) { option.addAttribute("delimiterExiste", "true"); option.addAttribute("delimiter", "" + delimiter); - matcher = Pattern.compile(delimiter + "[<\\.\\|]+").matcher( + matcher = Pattern.compile(delimiter + "(([a-zA-Z][\\w-]+)|(<[a-zA-Z][^>]*>))").matcher( option_stringTmp); - String option_argument; if (matcher.find()) { option_argument = matcher.group().substring(1, matcher.group().length()); option.addAttribute("option_argument", option_argument); if (option_stringTmp.charAt(option_argument.length() + 1) == ',') { delimiter = ','; - line = line.substring(option_string.length() - + option_argument.length() + 3, line - .length()); +// line = line.substring(option_string.length() +// + option_argument.length() + 3, line +// .length()); } else { done = true; } @@ -691,9 +699,13 @@ } } } + if (delimiter == ',') { + line = line.substring(option_string.length() + 1 + + (option_argument == null ? 0 : option_argument.length())); + } if (done) { result.setText(option_stringTmp.substring(matcher.end(), option_stringTmp.length()).trim() - + " " + joinBlock(readBlock(1))); + + " " + joinBlock(readBlock(1))); } } while (delimiter == ','); } @@ -942,7 +954,7 @@ String line = in.readLine(); if (line != null) { if (line.matches("\\s.*")) { - int level = level(line); + int level = level(line); String savedLine = line + " " + joinBlock(readBlock(level)); line = in.readLine(); @@ -1156,7 +1168,7 @@ beginPeek(); Element result = null; - // in.skipBlankLines(); + //in.skipBlankLines(); String[] lines; do { @@ -1423,6 +1435,7 @@ cell.addAttribute(CELL_END, "false"); } else { cell = (Element) row.node(cellNumber); + } cell.addAttribute(CELL_INDEX_START, String .valueOf(start)); @@ -2120,18 +2133,18 @@ result.setText(line.substring(2).trim()); line = in.readLine(); if(line != null) { - int level = level(line); - if (level > 0) { - String[] lines = readBlock(level); - String text = line.substring(level); - for (String l : lines) { - text += "\n" + l.substring(level); - } - result.addText(text); + int level = level(line); + if (level > 0) { + String[] lines = readBlock(level); + String text = line.substring(level); + for (String l : lines) { + text += "\n" + l.substring(level); } + result.addText(text); } } } + } endPeek(); return result; Index: main/resources/xsl/rst2xhtml.xsl =================================================================== --- main/resources/xsl/rst2xhtml.xsl (revision 545) +++ main/resources/xsl/rst2xhtml.xsl (working copy) @@ -478,12 +478,13 @@ + , - , + Index: test/resources/frEntier.rst =================================================================== --- test/resources/frEntier.rst (revision 556) +++ test/resources/frEntier.rst (working copy) @@ -71,9 +71,9 @@ Cette commande aura pour effet de convertir le fichier myfile.rst en XML qui sera affich�� sur la sortie standard (console). Plusieurs options sont disponibles : --o file, --outFile=file pour rediriger la sortie vers un fichier. --t format, --outType format pour pr��ciser un format de sortie, donc utiliser un ou des fichiers XSL de g��n��ration. Plusieurs formats sont disponibles xhtml, docbook, xml, html, xdoc, rst, pdf, odt, rtf. --x xslFile, --xslFile xslFile sert �� pr��ciser le fichier xsl de g��n��ration �� utiliser. +-o file,--outFile=file pour rediriger la sortie vers un fichier. +-t format,--outType format pour pr��ciser un format de sortie, donc utiliser un ou des fichiers XSL de g��n��ration. Plusieurs formats sont disponibles xhtml, docbook, xml, html, xdoc, rst, pdf, odt, rtf. +-x xslFile,--xslFile xslFile sert �� pr��ciser le fichier xsl de g��n��ration �� utiliser. --force forcer l'��criture d'un fichier, si le fichier de sortie existe, il sera remplac��. --help pour afficher les options disponibles : @@ -831,7 +831,7 @@ ``|`` Gauche|Milieu Indique une alternative (un noeud ou bien l'autre (ou les deux)) / personne/nom Chemin d'acc��s aux ��l��ments (personne/bras/gauche) * * Motif "joker" d��signant n'importe quel ��l��ment -// //personne Indique tous les descendants d'un noeud +``//`` ``//``personne Indique tous les descendants d'un noeud . . Caract��rise le noeud courant ``..`` ``..`` D��signe le noeud parent @ @valeur Indique un attribut caract��ristique