complete rewrite with somewhat more proper support of markdown syntax and more compliant token search
This commit is contained in:
parent
38e0ee2dfb
commit
75c4c11205
988
document.rb
988
document.rb
File diff suppressed because it is too large
Load Diff
2
mdpp.rb
2
mdpp.rb
|
@ -89,7 +89,7 @@ module MDPP
|
||||||
line = word
|
line = word
|
||||||
next
|
next
|
||||||
end
|
end
|
||||||
line = [line, word].join(' ')
|
line = [line, word].join(line.end_with?("\n") ? '' : ' ')
|
||||||
end
|
end
|
||||||
output.append(line.lstrip)
|
output.append(line.lstrip)
|
||||||
output.join("\n")
|
output.join("\n")
|
||||||
|
|
41
test.md
41
test.md
|
@ -6,16 +6,48 @@
|
||||||
> Block quote **bold** and *italics* test
|
> Block quote **bold** and *italics* test
|
||||||
> Block quote **bold *italics* mix** test
|
> Block quote **bold *italics* mix** test
|
||||||
|
|
||||||
|
> Nested block quote test
|
||||||
|
> > with a very stupid secondary quote syntax
|
||||||
|
this should end the block quote btw
|
||||||
|
|
||||||
## Header level 2
|
## Header level 2
|
||||||
|
|
||||||
[link](http://example.com)
|
also header level 2
|
||||||
|
---
|
||||||
|
|
||||||
|
also header level 1
|
||||||
|
===
|
||||||
|
|
||||||
|
not a header level2
|
||||||
|
---asdlkashdlkasjd
|
||||||
|
|
||||||
|
not a header level1
|
||||||
|
===asdajlsdkjlsd
|
||||||
|
|
||||||
|
not a header level2
|
||||||
|
---
|
||||||
|
|
||||||
|
not a header level1
|
||||||
|
===
|
||||||
|
[link](http://example.com)
|
||||||
![image alt text](http://example.com)
|
![image alt text](http://example.com)
|
||||||
|
|
||||||
```plaintext
|
``` plaintext
|
||||||
code *block*
|
code *block*
|
||||||
eat my shit
|
eat my shit
|
||||||
```
|
```
|
||||||
|
|
||||||
|
> It is also of importance to note that this code is a hello world program,
|
||||||
|
> written entirely in C++.
|
||||||
|
>
|
||||||
|
> ```cpp
|
||||||
|
> int main() {
|
||||||
|
> cout << "Hello **world!**";
|
||||||
|
> }
|
||||||
|
> ```
|
||||||
|
|
||||||
|
> theoretical failure test case
|
||||||
|
> **bold** **with space**
|
||||||
paragraph with ``inline code block``
|
paragraph with ``inline code block``
|
||||||
|
|
||||||
- Unordered list element 1
|
- Unordered list element 1
|
||||||
|
@ -24,6 +56,11 @@ paragraph with ``inline code block``
|
||||||
1. Ordered list element 1
|
1. Ordered list element 1
|
||||||
2. Ordered list element 2
|
2. Ordered list element 2
|
||||||
|
|
||||||
|
1. [Link](https://ass.com)
|
||||||
|
2. [Lv2](https://ass.com)
|
||||||
|
3. [Lv2](https://anus.com)
|
||||||
|
4. shit
|
||||||
|
|
||||||
This is not a list
|
This is not a list
|
||||||
- because it continues the paragraph
|
- because it continues the paragraph
|
||||||
- this is how it should be, like it or not
|
- this is how it should be, like it or not
|
||||||
|
|
Loading…
Reference in New Issue