File tree Expand file tree Collapse file tree 2 files changed +12
-21
lines changed Expand file tree Collapse file tree 2 files changed +12
-21
lines changed Original file line number Diff line number Diff line change 1
- require 'rdoc/generators/html_generator'
2
- require 'ostruct'
1
+ require "rdoc/markup/to_html"
3
2
4
3
module GitHub
5
4
module Markup
@@ -9,11 +8,8 @@ def initialize(content)
9
8
end
10
9
11
10
def to_html
12
- simple_markup = SM ::SimpleMarkup . new
13
- generator = Generators ::HyperlinkHtml . new ( '' , OpenStruct . new )
14
- simple_markup . add_special ( /((link:|https?:|mailto:|ftp:|www\. )\S +\w )/ , :HYPERLINK )
15
- simple_markup . add_special ( /(((\{ .*?\} )|\b \S +?)\[ \S +?\. \S +?\] )/ , :TIDYLINK )
16
- simple_markup . convert ( @content , generator )
11
+ h = ::RDoc ::Markup ::ToHtml . new
12
+ h . convert ( @content )
17
13
end
18
14
end
19
15
end
Original file line number Diff line number Diff line change 1
- < ul >
2
- < li > One
1
+ < ul > < li >
2
+ < p > One</ p >
3
+ </ li > < li >
4
+ < p > Two</ p >
5
+ </ li > </ ul >
3
6
4
- </ li >
5
- < li > Two
7
+ < p > This is an < a href =" http://github.com " > absolute link </ a > . So is this: < a
8
+ href =" http://github.com " > github.com </ a > </ p >
6
9
7
- </ li >
8
- </ ul >
9
- < p >
10
- This is an < a href ="http://github.com "> absolute link</ a > . So is this: < a
11
- href ="http://github.com "> github.com</ a >
12
- </ p >
13
- < p >
14
- This is a < a href ="rawr.html "> relative link</ a > . So is this: < a
15
- href ="rawr.html "> rawr.html</ a >
16
- </ p >
10
+ < p > This is a < a href ="rawr.html "> relative link</ a > . So is this: < a
11
+ href ="rawr.html "> rawr.html</ a > </ p >
You can’t perform that action at this time.
0 commit comments