File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -75,7 +75,7 @@ def url_link(text, url)
7575 #
7676 def markdown ( text )
7777 text
78- . gsub ( /(?<!\* )\* ([^*]+)\* (?!\* )/ , '_\1_' ) # italic
78+ . gsub ( /(?<!\* )\* ([^*\n ]+)\* (?!\* )/ , '_\1_' ) # italic
7979 . gsub ( /\* \* \* (.*?)\* \* \* / , '*_\1_*' ) # bold & italic
8080 . gsub ( /\* \* (.*?)\* \* / , '*\1*' ) # bold
8181 . gsub ( /~~(.*?)~~/ , '~\1~' ) # strikethrough
Original file line number Diff line number Diff line change 149149 )
150150 end
151151
152+ it "doesn't treat list items as text formatting" do
153+ msg = <<~MSG
154+ Une liste:
155+
156+ * Article 1
157+ * Article 2
158+ * Article 3
159+ MSG
160+
161+ expect ( formatting . markdown ( msg ) ) . to eq msg
162+ end
163+
152164 it "doesn't format other markdown" do
153165 expect ( formatting . markdown ( '## A heading\n_Italics_\n`code`' ) ) . to eq '## A heading\n_Italics_\n`code`'
154166 end
You can’t perform that action at this time.
0 commit comments