Permalink
Browse files

Simple_markup: delimit emph with "__", not "_".

  • Loading branch information...
1 parent a2d59b5 commit e2a83f988a16b990b05708d62f925245c9545b60 @mfp committed Feb 14, 2009
Showing with 8 additions and 6 deletions.
  1. +1 −1 simple_markup.ml
  2. +7 −5 test_simple_markup.ml
View
@@ -270,7 +270,7 @@ and scan s st n =
delimited (fun ~first ~last -> Bold (unescape_slice s ~first ~last)) "*"
s st n
| '_' ->
- delimited (fun ~first ~last -> Emph (unescape_slice s ~first ~last)) "_"
+ delimited (fun ~first ~last -> Emph (unescape_slice s ~first ~last)) "__"
s st n
| '=' ->
delimited
View
@@ -82,14 +82,14 @@ let test_read_normal () =
check
[Normal
[Text "foo "; Bold "bar"; Text " "; Bold "baz"; Text " ";
- Emph "foobar"; Text " ";
+ Emph "foobar"; Text " _foobar_";
Link { href_target = "target"; href_desc = "desc"};
Image { img_src = "image"; img_alt = "alt"};
Text "."]]
- "foo *bar* *baz* _foobar_ [desc](target)![alt](image).";
+ "foo *bar* *baz* __foobar__ _foobar_[desc](target)![alt](image).";
check
- [Normal [Bold "foo"; Text " "; Struck [Bold "foo"; Emph "bar"]]]
- "*foo* ==*foo*_bar_==";
+ [Normal [Bold "foo"; Text " "; Struck [Bold "foo"; Emph "bar"; Text "_baz_"]]]
+ "*foo* ==*foo*__bar___baz_==";
check
[Normal
[Link { href_target = "http://foo.com"; href_desc = "http://foo.com" }]]
@@ -104,6 +104,7 @@ let test_read_normal () =
let test_read_normal_unmatched () =
check [Normal [Text "foo * bar"]] "foo * bar";
check [Normal [Text "foo _ bar"]] "foo _ bar";
+ check [Normal [Text "foo __ bar"]] "foo __ bar";
check [Normal [Text "foo == bar"]] "foo == bar";
check [Normal [Text "foo == bar"]; Normal [Text "baz =="]] "foo == bar\n\nbaz =="
@@ -149,14 +150,15 @@ let test_quote () =
check [Normal [Text "foo says:"];
Quote [Normal [Text "xxx:"];
Ulist ([Normal [Text "xxx yyy"]],
- [[Normal [Emph "2"]]; [Normal [Bold "3"]]]);
+ [[Normal [Emph "2"]]; [Normal [Text "_2_"]]; [Normal [Bold "3"]]]);
Quote [Normal [Text "yyy"]; Quote [Normal [Text "zzz"]];
Normal [Text "aaa"]]]]
"foo says:\n\
\n\
> xxx:\n\
> * xxx\n\
> yyy\n\
+ > * __2__\n\
> * _2_\n\
> * *3*\n\
> > yyy\n\

0 comments on commit e2a83f9

Please sign in to comment.