summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrsiddharth <rsiddharth@ninthfloor.org>2012-06-27 09:23:35 +0530
committerrsiddharth <rsiddharth@ninthfloor.org>2012-06-27 09:23:35 +0530
commit808b83282c7e18d831f0be85cfae84d707a53956 (patch)
treea93ff7c7acd61ff7f92e9bf7a8c2e5f598fbd09b
parent726314a77a2138f8d6bca200af9972e006f43311 (diff)
Paragraphs.java changed
-rw-r--r--parsers/Paragraphs.java11
1 files changed, 7 insertions, 4 deletions
diff --git a/parsers/Paragraphs.java b/parsers/Paragraphs.java
index 295d14a..864877d 100644
--- a/parsers/Paragraphs.java
+++ b/parsers/Paragraphs.java
@@ -15,14 +15,17 @@ public class Paragraphs implements Parser {
* tags in place.
*/
Pattern pattern = Pattern.compile("((\\={10,})\\n(.+?)\\n(\\2))|((^.+$\\n)+)",Pattern.MULTILINE);
+ Pattern htmlTagPattern = Pattern.compile("^\\<.+?\\>\\n");
Matcher matcher = pattern.matcher(fileContent);
+ Matcher htmlTag;
StringBuffer sbuffer = new StringBuffer();
while(matcher.find()) {
- // group 1 contains the regex for the Heading, so
- // if that is null, then it means that we have actually
- // found a paragraph.
- if(matcher.group(1)==null)
+ htmlTag = htmlTagPattern.matcher(matcher.group());
+ if(htmlTag.find()) {
+ System.out.println(htmlTag.group());
+ }else {
matcher.appendReplacement(sbuffer,paragraph);
+ }
}
matcher.appendTail(sbuffer);
return sbuffer.toString();