Render italic and bold in Markdown.
Scribble => Markdown @bold{text} **text** @italic{text} _text_
This commit is contained in:
parent
dd5b999c64
commit
00a5bf63b1
|
@ -176,8 +176,7 @@
|
||||||
(if (target-url? p) p #f)))
|
(if (target-url? p) p #f)))
|
||||||
(define url (and targ (target-url-addr targ)))
|
(define url (and targ (target-url-addr targ)))
|
||||||
(begin0
|
(begin0
|
||||||
(cond [url
|
(cond [url (define new-i
|
||||||
(define new-i
|
|
||||||
(match (element-content i)
|
(match (element-content i)
|
||||||
[(list (? string? s))
|
[(list (? string? s))
|
||||||
(element (element-style i)
|
(element (element-style i)
|
||||||
|
@ -191,8 +190,15 @@
|
||||||
(eq? 'hspace (style-name s))))))
|
(eq? 'hspace (style-name s))))))
|
||||||
(parameterize ([current-preserve-spaces #t])
|
(parameterize ([current-preserve-spaces #t])
|
||||||
(super render-content i part ri))]
|
(super render-content i part ri))]
|
||||||
[else
|
[else (define style (and (element? i) (element-style i)))
|
||||||
(super render-content i part ri)])
|
(define bold? (eq? style 'bold))
|
||||||
|
(define italic? (eq? style 'italic))
|
||||||
|
(cond [bold? (display "**")]
|
||||||
|
[italic? (display "_")])
|
||||||
|
(begin0
|
||||||
|
(super render-content i part ri)
|
||||||
|
(cond [bold? (display "**")]
|
||||||
|
[italic? (display "_")]))])
|
||||||
(when tick?
|
(when tick?
|
||||||
(phrase-ticks-depth (sub1 (phrase-ticks-depth)))
|
(phrase-ticks-depth (sub1 (phrase-ticks-depth)))
|
||||||
(when (zero? (phrase-ticks-depth))
|
(when (zero? (phrase-ticks-depth))
|
||||||
|
|
|
@ -10,9 +10,9 @@
|
||||||
|
|
||||||
[I am a hyperlink to Racket.](http://www.racket-lang.org/)
|
[I am a hyperlink to Racket.](http://www.racket-lang.org/)
|
||||||
|
|
||||||
Italic. \_Just underlines\_.
|
_Italic_. \_Just underlines\_.
|
||||||
|
|
||||||
Bold. \*Just asterisks.\*
|
**Bold**. \*Just asterisks.\*
|
||||||
|
|
||||||
“Dobule quoted”. ‘Single quoted’.
|
“Dobule quoted”. ‘Single quoted’.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user