summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrsiddharth <rsd@scruf>2012-10-25 01:11:30 +0530
committerrsiddharth <rsd@scruf>2012-10-25 01:11:30 +0530
commit3124c400d828cacdf6b39cec92e6ba4e78253807 (patch)
tree7498fc27006726cff28bbf4d04900622254ce963
parent5d892e9b95b9ee54aa3d5b34a9f2700a30101d2d (diff)
parentd8883d357e25209747c8535bfd3b5a6e8d80dc57 (diff)
--> merged from devel branch.
added: notes modified: license/gpl parsers/CodeBlocks.java parsers/WordDecoration.java
-rw-r--r--license/gpl10
-rw-r--r--notes14
-rw-r--r--parsers/CodeBlocks.java6
-rw-r--r--parsers/WordDecoration.java11
4 files changed, 29 insertions, 12 deletions
diff --git a/license/gpl b/license/gpl
index 133291f..026ff62 100644
--- a/license/gpl
+++ b/license/gpl
@@ -1,8 +1,10 @@
/*+
- * Copyright (C) 2012-2013 rsiddharth
- * email me : rsiddharth@ninthfloor.org
- *
- * This program is free software: you can redistribute it and/or modify
+ * Copyright 2012 rsiddharth
+ * Email: rsiddharth@ninthfloor.org
+ *
+ * This file is part of Scruf.
+ *
+ * Scruf is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
diff --git a/notes b/notes
new file mode 100644
index 0000000..fb553c5
--- /dev/null
+++ b/notes
@@ -0,0 +1,14 @@
+markdown
+
++ tags can be added in the markdown text, but they should *not* be
+indented. The paragraph parser should recognize /tagged/ blocks and
+simply ignore them.
+
++ ` < ' if something starts with this, please don't parse the
+following entity.
+
++ automatic conversion of & --> &amp; according to the context.
+ autometic conversion of < --> &lt; according to the context.
+
+ inside spans or blocks markdown always encodes the > &amp; & to
+ correponding thingies explained above. \ No newline at end of file
diff --git a/parsers/CodeBlocks.java b/parsers/CodeBlocks.java
index f3adb52..50794a5 100644
--- a/parsers/CodeBlocks.java
+++ b/parsers/CodeBlocks.java
@@ -4,7 +4,7 @@ import java.util.regex.*;
public class CodeBlocks implements Parser {
public String parse(String fileContent) {
- Pattern pattern = Pattern.compile("(\\~\\~)\\n*(.+?)\\n*(\\1)",
+ Pattern pattern = Pattern.compile("(\\#\\#\\#)\\n*(.+?)\\n*(\\1)",
Pattern.DOTALL);
Matcher matcher = pattern.matcher(fileContent);
LineBreak lbreak = new LineBreak();
@@ -12,9 +12,9 @@ public class CodeBlocks implements Parser {
StringBuilder replacement = new StringBuilder();
while(matcher.find()) {
replacement.delete(0,replacement.length());
- replacement.append("<code>");
+ replacement.append("<div class=\\\"code\\\">");
replacement.append(quote(lbreak.parse(matcher.group(2))));
- replacement.append("</code>");
+ replacement.append("</div>");
matcher.appendReplacement(sbuffer,replacement.toString());
}
matcher.appendTail(sbuffer);
diff --git a/parsers/WordDecoration.java b/parsers/WordDecoration.java
index b2df37e..66a5183 100644
--- a/parsers/WordDecoration.java
+++ b/parsers/WordDecoration.java
@@ -9,14 +9,15 @@ public class WordDecoration implements Parser {
private HashMap<String, String> tagMap;
public WordDecoration() {
tagMap = new HashMap<String, String>();
- tagMap.put("''","<i>$6</i>");
- tagMap.put("__","<u>$6</u>");
- tagMap.put("'''","<b>$6</b>");
- tagMap.put("%%%","<blockquote>$6</blockquote>");
+ tagMap.put("''","<i>$7</i>");
+ tagMap.put("__","<u>$7</u>");
+ tagMap.put("'''","<b>$7</b>");
+ tagMap.put("%%%","<blockquote>$7</blockquote>");
+ tagMap.put("`","<div class=\\\"monospace\\\">$7</div>");
}
public String parse(String fileContent) {
Pattern pattern =
- Pattern.compile("((\\'\\'\\')|(\\_\\_)|(\\'\\')|(\\%\\%\\%))(.+?)((\\2)|(\\3)|(\\4)|(\\5))",
+ Pattern.compile("((\\'\\'\\')|(\\_\\_)|(\\'\\')|(\\%\\%\\%))|(\\`))(.+?)((\\2)|(\\3)|(\\4)|(\\5)|(\\6))",
Pattern.DOTALL);
Matcher matcher = pattern.matcher(fileContent);
StringBuffer sbuffer = new StringBuffer();