Index: jrst2/src/java/org/codelutin/jrst/JRSTLexer.java diff -u jrst2/src/java/org/codelutin/jrst/JRSTLexer.java:1.16 jrst2/src/java/org/codelutin/jrst/JRSTLexer.java:1.17 --- jrst2/src/java/org/codelutin/jrst/JRSTLexer.java:1.16 Thu May 3 16:37:08 2007 +++ jrst2/src/java/org/codelutin/jrst/JRSTLexer.java Fri May 4 16:23:28 2007 @@ -1,6 +1,6 @@ /* *##% * Copyright (C) 2006 - * Code Lutin, Cédric Pineau, Benjamin Poussin + * Code Lutin, C�dric Pineau, Benjamin Poussin * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -23,9 +23,9 @@ * Created: 28 oct. 06 00:44:20 * * @author poussin - * @version $Revision: 1.16 $ + * @version $Revision: 1.17 $ * - * Last update: $Date: 2007/05/03 16:37:08 $ + * Last update: $Date: 2007/05/04 16:23:28 $ * by : $Author: sletellier $ */ @@ -50,10 +50,10 @@ /** * Le principe est de positionner la mark du {@link AdvancedReader} lors du * debut d'une methode peek*, puis a la fin de la methode de regarder le nombre - * de caractere utilisé pour la methode et de faire un reset. + * de caractere utilis� pour la methode et de faire un reset. *

- * Le nombre de caractere utilisé servira pour le remove lorsque l'utilisateur - * indiquera qu'il utilise l'element retourné, si l'utilisateur n'appelle pas + * Le nombre de caractere utilis� servira pour le remove lorsque l'utilisateur + * indiquera qu'il utilise l'element retourn�, si l'utilisateur n'appelle pas * remove alors il peut relire autant de fois qu'il veut le meme element, ou * essayer d'en lire un autre. *

@@ -420,7 +420,7 @@ Element result = null; String line = in.readLine(); if (line != null){ - // Le header est parsé des le debut + // Le header est pars� des le debut if (line.matches("^\\s*.. "+HEADER+":: .*")){ result= DocumentHelper.createElement("remove").addAttribute("level", ""+level(line)); } @@ -1295,7 +1295,7 @@ - Second item in bullet list (row 3, column 2). ============ ====== - devient l'équivalent : + devient l'�quivalent : ===== ===== ====== Inputs Output ------------ ------ @@ -1723,7 +1723,7 @@ Element result = null; String line = in.readLine(); if (line!=null){ - if (line.matches("^\\s*\\.\\.\\s\\[(#|[0-9]).*\\]\\s.+$")){ + if (line.matches("^\\s*\\.\\.\\s\\[(#|[0-9]|\\*).*\\]\\s.+$")){ result = DocumentHelper.createElement("footnotes"); boolean bLine = false; do{ @@ -1740,7 +1740,10 @@ result.addAttribute("level", ""+level(line)); String id = line.substring(matcher.end(), i); - if (id.matches("[0-9]")){ + if (id.matches("\\*")){ + footnote.addAttribute("type", "autoSymbol"); + } + else if (id.matches("[0-9]")){ footnote.addAttribute("type", "num"); footnote.addAttribute("name", id); } @@ -1756,7 +1759,7 @@ int levelAv = level(line); line = in.readLine(); if (line!=null){ - if (line.matches("^\\s*\\.\\.\\s\\[(#|[0-9]).*\\]\\s.+$")){ + if (line.matches("^\\s*\\.\\.\\s\\[(#|[0-9]|\\*).*\\]\\s.+$")){ bLine=true; }else if (!line.matches("\\s")){ @@ -1771,7 +1774,7 @@ } if (!bLine){ in.skipBlankLines(); - String[] linesTmp = in.readWhile("^\\s*\\.\\.\\s\\[(#|[0-9]).*\\]\\s.+$"); + String[] linesTmp = in.readWhile("^\\s*\\.\\.\\s\\[(#|[0-9]|\\*).*\\]\\s.+$"); if (linesTmp.length>0){ line=linesTmp[0]; Index: jrst2/src/java/org/codelutin/jrst/ReStructuredText.java diff -u jrst2/src/java/org/codelutin/jrst/ReStructuredText.java:1.5 jrst2/src/java/org/codelutin/jrst/ReStructuredText.java:1.6 --- jrst2/src/java/org/codelutin/jrst/ReStructuredText.java:1.5 Thu May 3 16:37:08 2007 +++ jrst2/src/java/org/codelutin/jrst/ReStructuredText.java Fri May 4 16:23:28 2007 @@ -1,6 +1,6 @@ /* *##% * Copyright (C) 2006 - * Code Lutin, Cédric Pineau, Benjamin Poussin + * Code Lutin, Cédric Pineau, Benjamin Poussin * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -23,9 +23,9 @@ * Created: 27 oct. 06 11:10:30 * * @author poussin - * @version $Revision: 1.5 $ + * @version $Revision: 1.6 $ * - * Last update: $Date: 2007/05/03 16:37:08 $ + * Last update: $Date: 2007/05/04 16:23:28 $ * by : $Author: sletellier $ */ @@ -48,7 +48,8 @@ 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 ADMONITION = "admonition|caution|danger|error|hint|important|note|tip|warning"; + public static final String FOOTNOTE_SYMBOL = "*†‡§¶#♠♥♦♣"; + // public static final String ADMONITION = "admonition|caution|danger|error|hint|important|note|tip|warning"; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Root Element //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -184,7 +185,7 @@ public static final Pattern REGEX_REFERENCE = Pattern.compile("(http://[-/%#&\\._\\w]+)([^-/%#&\\._\\w]|$)"); public static final Pattern REGEX_INLINE_REFERENCE = Pattern.compile("`(.+) ?<(http://[-/%#&\\._\\w]+)>`_"); public static final Pattern REGEX_EMAIL = Pattern.compile("(^|[^_\\w])([-\\._\\w]+@[-\\._\\w]+)([^-\\._\\w]|$)"); - public static final Pattern REGEX_FOOTNOTE_REFERENCE = Pattern.compile("\\[(#|[0-9])\\w*\\]_"); + public static final Pattern REGEX_FOOTNOTE_REFERENCE = Pattern.compile("\\[(#|[0-9]|\\*)\\w*\\]_"); //"\\[([0-9]+?|#)\\]"); public static final Pattern REGEX_CITATION_REFERENCE = Pattern.compile("\\[([^\\]]+?)\\]"); public static final Pattern REGEX_SUBSTITUTION_REFERENCE = Pattern.compile("\\|([^|]+?)\\|"); Index: jrst2/src/java/org/codelutin/jrst/JRSTReader.java diff -u jrst2/src/java/org/codelutin/jrst/JRSTReader.java:1.16 jrst2/src/java/org/codelutin/jrst/JRSTReader.java:1.17 --- jrst2/src/java/org/codelutin/jrst/JRSTReader.java:1.16 Thu May 3 16:37:08 2007 +++ jrst2/src/java/org/codelutin/jrst/JRSTReader.java Fri May 4 16:23:28 2007 @@ -1,6 +1,6 @@ /* *##% * Copyright (C) 2006 - * Code Lutin, Cédric Pineau, Benjamin Poussin + * Code Lutin, Cédric Pineau, Benjamin Poussin * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -23,9 +23,9 @@ * Created: 27 oct. 06 00:15:34 * * @author poussin - * @version $Revision: 1.16 $ + * @version $Revision: 1.17 $ * - * Last update: $Date: 2007/05/03 16:37:08 $ + * Last update: $Date: 2007/05/04 16:23:28 $ * by : $Author: sletellier $ */ @@ -294,6 +294,8 @@ protected Map directives = new HashMap(); private int idMax = 0; + private int symbolMax = 0; + private int symbolMaxRef = 0; private LinkedList lblFootnotes = new LinkedList(); private LinkedList lblFootnotesRef = new LinkedList(); private LinkedList eFootnotes = new LinkedList(); @@ -644,6 +646,7 @@ * @return Element * @throws Exception */ + // TODO bug caractere speciaux : auto-symbols private Element[] composeFootnote(Element item) throws Exception { Element[] result=null; if (itemEquals("footnotes", item) ) { @@ -674,6 +677,9 @@ if (type.equals("autoNum") || type.equals("autoNumLabel")){ result[cnt].addAttribute("auto", "1"); } + if (type.equals("autoSymbol")){ + result[cnt].addAttribute("auto", "*"); + } result[cnt].addAttribute("backrefs","id"+idMax); efootnote.addAttribute("backrefs", "id"+idMax); if (type.equals("num") || type.equals("autoNumLabel")){ @@ -697,13 +703,26 @@ if (type.equals("autoNum")) 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 cells = (List)rows.get(r).selectNodes(JRSTLexer.CELL); for (int c=0; c