Permalink
Browse files

Escape for ordered and unordered lists when converting HTML to markdown

  • Loading branch information...
1 parent c722210 commit 2c11b2a668cca27c80e30818973cab3e1cb04b9f @stephenharris committed Dec 7, 2013
Showing with 2 additions and 0 deletions.
  1. +2 −0 markdownify/markdownify.php
@@ -244,6 +244,8 @@ function parseString($html) {
'`(.+)`' => '\`$1\`', # code
'\[(.+)\](\s*\()' => '\[$1\]$2', # links: [text] (url) => [text\] (url)
'\[([^\]]+)\](\s*)\[(\d)\]' => '\[$1\]$2\[$3\]', # links: [text][integer] => \[text\]\[integer\]
+ '^([0-9]+)\.(.*)$' => '$1\.$2', #ordered lists [integer].[text] => [integer]\.[text]
+ '^(-)\.(.*)$' => '$1\.$2' #unordered lists [-].[text] => [-]\.[text]
);
/**
* wether last processed node was a block tag or not

0 comments on commit 2c11b2a

Please sign in to comment.