scruf

darn simple HTML5 doc generator
git clone git://git.ricketyspace.net/scruf.git
Log | Files | Refs | README

commit 250cf4befea71a2ec6d917d104d20c702e7d4551
parent 8bcd7f58acd38f5d5e1731f89be4a10a79d0fdb7
Author: rsiddharth <rsiddharth@ninthfloor.org>
Date:   Sun, 24 Jun 2012 12:06:09 +0530

Two files were modified (bug fix):

 --> conversion/FileSieve.java : regex modified to ignore hidden files.

 --> parsers/Images.java : html tag (for image) was erroneous, it was rectified and as a consequence we got rid of 3 
lines 
of code.

Diffstat:
conversion/FileSieve.java | 2+-
parsers/Images.java | 4+---
2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/conversion/FileSieve.java b/conversion/FileSieve.java @@ -7,7 +7,7 @@ public class FileSieve implements FileFilter { // this method return true, if this file doesn't represent // a html file. public boolean accept(File pathname) { - Pattern pattern = Pattern.compile("(.+\\.(html|png|jpg|css|tar))|(.+?\\~)|(index)"); + Pattern pattern = Pattern.compile("(.+\\.(html|png|jpg|css|tar))|(.+?\\~)|(index)|(\\..+)"); Matcher matcher = pattern.matcher(pathname.getName()); boolean bool = matcher.find(); return !bool; diff --git a/parsers/Images.java b/parsers/Images.java @@ -8,9 +8,7 @@ public class Images implements Parser { Matcher matcher = pattern.matcher(fileContent); StringBuffer sbuffer = new StringBuffer(); StringBuilder replacementString = new StringBuilder(); - replacementString.append("<div class=\"img\">"); - replacementString.append("<image src=\"$1\" alt=\"$3\" />"); - replacementString.append("</div>"); + replacementString.append("<img src=\"$1\" alt=\"$3\" title=\"$3\"/>"); while(matcher.find()) { matcher.appendReplacement(sbuffer,replacementString.toString()); }