Index: JRSTLexer.java =================================================================== --- JRSTLexer.java (revision 547) +++ JRSTLexer.java (working copy) @@ -969,6 +969,7 @@ result.addAttribute(ATTRIBUTION, blockQuote); } result.setText(savedLine + txt); + log.info(result == null ? "result : null" : "result [" + result.asXML()); } } } @@ -1106,7 +1107,7 @@ directive.addAttribute(DIRECTIVE_TYPE, directiveType); directive.addAttribute(DIRECTIVE_VALUE, directiveValue); - String[] lines = readBlock(2); + String[] lines = readBlock(1); String text = joinBlock(lines, "\n", false); directive.setText(text); @@ -1157,7 +1158,7 @@ beginPeek(); Element result = null; - // in.skipBlankLines(); + //in.skipBlankLines(); String[] lines; do { Index: directive/ImageDirective.java =================================================================== --- directive/ImageDirective.java (revision 545) +++ directive/ImageDirective.java (working copy) @@ -49,6 +49,10 @@ * by : $Author$ */ public class ImageDirective implements JRSTDirective { + + private static String SCALE = "scale"; + private static String WIDTH = "width"; + private static String HEIGHT = "height"; /* * (non-Javadoc) @@ -73,8 +77,17 @@ if (matcher.matches()) { String name = matcher.group(1); String value = matcher.group(2); + if (SCALE.equalsIgnoreCase(name)) { + if (! result.asXML().matches(".*" + WIDTH + "=\".*\".*")) { + result.addAttribute(WIDTH, value + (value.matches(".*%") ? "" : "%")); + } + if (! result.asXML().matches(".*" + HEIGHT + "=\".*\".*")) { + result.addAttribute(HEIGHT, value + (value.matches(".*%") ? "" : "%")); + } + } result.addAttribute(name, value); } + System.out.println("result [" + result.asXML() + "]"); } return result; }