Skip to content

Commit

Permalink
fix: better paragraph handling in BBCode to/from HTML conversion (#683)
Browse files Browse the repository at this point in the history
  • Loading branch information
AkesiSeli authored Dec 26, 2024
1 parent 6a7a570 commit 7fd10c4
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ internal class DefaultBBCodeConverter : BBCodeConverter {
.replace("[/i]", "</i>")
.replace("[b]", "<b>")
.replace("[/b]", "</b>")
.replace("[p]", "<p>")
.replace("[/p]", "</p>")
.replace("[code]", "<code>")
.replace("[/code]", "</code>")
.replace("[ul]", "<ul>")
Expand Down Expand Up @@ -69,6 +71,7 @@ internal class DefaultBBCodeConverter : BBCodeConverter {
"ul" -> builder.append("[ul]")
"ol" -> builder.append("[ol]")
"li" -> builder.append("[li]")
"p" -> builder.append("[p]")
"code" -> builder.append("[code]")
"blockquote" -> builder.append("[quote]")
"q" -> builder.append("[quote]")
Expand All @@ -93,12 +96,13 @@ internal class DefaultBBCodeConverter : BBCodeConverter {
"h4" -> builder.append("[/h4]")
"h5" -> builder.append("[/h5]")
"span" -> Unit
"p", "br" -> builder.append("\n")
"br" -> builder.append("\n")
"img" -> builder.append("[/img]")
"b", "strong" -> builder.append("[/b]")
"u" -> builder.append("[/u]")
"i", "em" -> builder.append("[/i]")
"s" -> builder.append("[/s]")
"p" -> builder.append("[/p]")
"code" -> builder.append("[/code]")
"a" -> builder.append("[/url]")
"ul" -> builder.append("[/ul]")
Expand Down

0 comments on commit 7fd10c4

Please sign in to comment.