summaryrefslogtreecommitdiffstats
path: root/parsers/Images.java
diff options
context:
space:
mode:
authorrsiddharth <rsiddharth@ninthfloor.org>2013-08-14 18:55:52 +0530
committerrsiddharth <rsiddharth@ninthfloor.org>2013-08-14 18:55:52 +0530
commit4618d216ccee183068725cba0778ff753bb656a4 (patch)
tree842246e2366384d6b82ad8f9bd1e5c29396c44be /parsers/Images.java
parent54e4ec0cc7f0b58e747729a0c5260044ca4c370f (diff)
parent83e1bf5f0e299b9d99c8e2b01aacd5cda9a37d1c (diff)
merged from the devel branch.
conversion/ConvertDirectory.java: * Changes in how `index.scruff' files are parsed. * StyleChecker checks where the stylesheet needs update/creation parsers/CodeBlocks.java: * code block tag changed from <div class="code"> --> <pre> parsers/Images.java: * image alt text formatted for nice viewing in text terminal * SVGs are recognized by the parser now parsers/QuoteSpecialText.java: * regex changed: styling/style.css * lot of changes to the default CSS.
Diffstat (limited to 'parsers/Images.java')
-rw-r--r--parsers/Images.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/parsers/Images.java b/parsers/Images.java
index 7bbe60a..f38ef46 100644
--- a/parsers/Images.java
+++ b/parsers/Images.java
@@ -25,10 +25,10 @@ import java.util.regex.*;
public class Images implements Parser {
// set of strings to build the img tag
- private String openTag = "<img src=\"$1\" alt=\" \\[$";
+ private String openTag = "<img src=\"$1\" alt=\" \\[ $";
private String closeTag = " />";
public String parse(String fileContent) {
- Pattern pattern = Pattern.compile("\\{\\{(.+?\\.(png|jpg))(\\|(.+?))?\\}\\}", Pattern.DOTALL);
+ Pattern pattern = Pattern.compile("\\{\\{(.+?\\.(png|jp[e]?g|svg))(\\|(.+?))?\\}\\}", Pattern.DOTALL);
Matcher matcher = pattern.matcher(fileContent);
StringBuffer sbuffer = new StringBuffer();
StringBuilder replacementString =new StringBuilder();
@@ -39,7 +39,7 @@ public class Images implements Parser {
replacementString.append(openTag);
// if the "title" is given add to the _img_ tag.
if(matcher.group(3)!=null) {
- replacementString.append("4\\] \" title=\"$4\"");
+ replacementString.append("4 \\] \" title=\"$4\"");
}
else {
replacementString.append("1\"");