File tree 5 files changed +17
-3
lines changed
5 files changed +17
-3
lines changed Original file line number Diff line number Diff line change 1
1
Scala Markdown
2
2
==============
3
3
4
+ [ Scala Markdown 1.4] ( http://scalamd.fusesource.org/maven/1.4 ) , December 22, 2010
5
+ ----
6
+
7
+ * Generated image tags were broken
8
+
4
9
[ Scala Markdown 1.3] ( http://scalamd.fusesource.org/maven/1.3 ) , December 16, 2010
5
10
----
6
11
Original file line number Diff line number Diff line change @@ -79,7 +79,7 @@ object Markdown {
79
79
" (?:" + htmlNameTokenExpr + " \\ s*=\\ s*\" [^\" ]*\" )|" +
80
80
" (?:" + htmlNameTokenExpr + " \\ s*=\\ s*'[^']*')|" +
81
81
" (?:" + htmlNameTokenExpr + " \\ s*=\\ s*[a-z0-9_:.\\ -]+)" +
82
- " )\\ s*)*)>" , Pattern .DOTALL | Pattern .CASE_INSENSITIVE )
82
+ " )\\ s*)*)/? >" , Pattern .DOTALL | Pattern .CASE_INSENSITIVE )
83
83
// Headers
84
84
val rH1 = Pattern .compile(" ^ {0,3}(\\ S.*?)( *\\ {#(.*?)\\ })?\\ n=+(?=\\ n+|\\ Z)" , Pattern .MULTILINE )
85
85
val rH2 = Pattern .compile(" ^ {0,3}(\\ S.*?)( *\\ {#(.*?)\\ })?\\ n-+(?=\\ n+|\\ Z)" , Pattern .MULTILINE )
@@ -255,10 +255,11 @@ class MarkdownText(source: CharSequence) {
255
255
* Encodes specially-treated characters inside the HTML tags.
256
256
*/
257
257
protected def encodeCharsInsideTags (text : StringEx ) =
258
- text.replaceAll(rInsideTags, m =>
258
+ text.replaceAll(rInsideTags, { m =>
259
+ val tail = if ( m.group(0 ).endsWith(" />" ) ) " />" else " >"
259
260
" <" + encodeUnsafeChars(new StringEx (m.group(1 )))
260
261
.replaceAll(rEscAmp, " &" )
261
- .toString + " > " )
262
+ .toString + tail} )
262
263
263
264
// ## Processing methods
264
265
Original file line number Diff line number Diff line change
1
+ < p > < img src ="/path/to/img.jpg " alt ="Alt text "/>
2
+ < img src ="/path/to/img.jpg " alt ="Alt text " title ="Optional title "/> </ p >
Original file line number Diff line number Diff line change
1
+ 
2
+ 
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ object MarkdownSpec extends Specification {
20
20
val textFile = new File (this .getClass.getResource(" /" + name + " .text" ).toURI)
21
21
val htmlFile = new File (this .getClass.getResource(" /" + name + " .html" ).toURI)
22
22
val text = Markdown (FileUtils .readFileToString(textFile, " UTF-8" )).trim
23
+ // println("[%s]".format(text))
23
24
val html = FileUtils .readFileToString(htmlFile, " UTF-8" ).trim
24
25
val diffIndex = StringUtils .indexOfDifference(text, html)
25
26
val diff = StringUtils .difference(text, html)
@@ -32,6 +33,9 @@ object MarkdownSpec extends Specification {
32
33
def process = addToSusVerb(" process" )
33
34
34
35
" MarkdownProcessor" should process {
36
+ " Images" in {
37
+ " Images" must beFine
38
+ }
35
39
" TOC" in {
36
40
" TOC" must beFine
37
41
}
You can’t perform that action at this time.
0 commit comments