nitlanguage
/
nit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
loader: build_module_importation invalidates the mmodule on errors
[nit.git]
/
lib
/
markdown
/
markdown.nit
diff --git
a/lib/markdown/markdown.nit
b/lib/markdown/markdown.nit
index
99dc87f
..
10dbcc6
100644
(file)
--- a/
lib/markdown/markdown.nit
+++ b/
lib/markdown/markdown.nit
@@
-31,7
+31,7
@@
import template
class MarkdownProcessor
# `MarkdownEmitter` used for ouput.
class MarkdownProcessor
# `MarkdownEmitter` used for ouput.
- var emitter: MarkdownEmitter is noinit
+ var emitter: MarkdownEmitter is noinit, protected writable
# Work in extended mode (default).
#
# Work in extended mode (default).
#
@@
-118,7
+118,7
@@
class MarkdownProcessor
init do self.emitter = new MarkdownEmitter(self)
# Process the mardown `input` string and return the processed output.
init do self.emitter = new MarkdownEmitter(self)
# Process the mardown `input` string and return the processed output.
- fun process(input: String): Streamable do
+ fun process(input: String): Writable do
# init processor
link_refs.clear
last_link_ref = null
# init processor
link_refs.clear
last_link_ref = null
@@
-537,7
+537,7
@@
class MarkdownEmitter
end
# Append `e` to current buffer.
end
# Append `e` to current buffer.
- fun add(e: Streamable) do
+ fun add(e: Writable) do
if e isa Text then
current_buffer.append e
else
if e isa Text then
current_buffer.append e
else
@@
-2412,7
+2412,6
@@
redef class Text
private fun meta_from_fence: nullable Text do
for i in [0..chars.length[ do
var c = chars[i]
private fun meta_from_fence: nullable Text do
for i in [0..chars.length[ do
var c = chars[i]
- print c
if c != ' ' and c != '`' and c != '~' then
return substring_from(i).trim
end
if c != ' ' and c != '`' and c != '~' then
return substring_from(i).trim
end
@@
-2443,7
+2442,7
@@
redef class String
# var md = "**Hello World!**"
# var html = md.md_to_html
# assert html == "<p><strong>Hello World!</strong></p>\n"
# var md = "**Hello World!**"
# var html = md.md_to_html
# assert html == "<p><strong>Hello World!</strong></p>\n"
- fun md_to_html: Streamable do
+ fun md_to_html: Writable do
var processor = new MarkdownProcessor
return processor.process(self)
end
var processor = new MarkdownProcessor
return processor.process(self)
end