aboutsummaryrefslogtreecommitdiff
path: root/html_backend.go
diff options
context:
space:
mode:
authorShulhan <m.shulhan@gmail.com>2020-12-05 02:16:56 +0700
committerShulhan <m.shulhan@gmail.com>2020-12-05 02:16:56 +0700
commite9fd480321f2d49d07b872e8371cbc5d3be68cea (patch)
tree59d97b5bf46e511a2355e59eedb282ff387f8b88 /html_backend.go
parent83ff35e591f0e7c23b6315fb8b6b836e1bcfb803 (diff)
downloadasciidoctor-go-e9fd480321f2d49d07b872e8371cbc5d3be68cea.tar.xz
html_backend: parse cell contents by paragraphs
If the cell contents contains multiple paragraphs, parse and render each of them as separated block paragraph.
Diffstat (limited to 'html_backend.go')
-rw-r--r--html_backend.go14
1 files changed, 10 insertions, 4 deletions
diff --git a/html_backend.go b/html_backend.go
index af8f05c..08d2775 100644
--- a/html_backend.go
+++ b/html_backend.go
@@ -635,10 +635,16 @@ func htmlWriteTableRow(doc *Document, table *adocTable, row *tableRow, out io.Wr
_ = subdoc.ToEmbeddedHTML(out)
case colStyleDefault:
- fmt.Fprintf(out, "<p class=%q>", classNameTableBlock)
- container := parseInlineMarkup(doc, contentTrimmed)
- container.toHTML(doc, out, false)
- fmt.Fprint(out, "</p>")
+ rawParagraphs := bytes.Split(contentTrimmed, []byte("\n\n"))
+ for x, p := range rawParagraphs {
+ if x > 0 {
+ fmt.Fprint(out, "\n")
+ }
+ fmt.Fprintf(out, "<p class=%q>", classNameTableBlock)
+ container := parseInlineMarkup(doc, p)
+ container.toHTML(doc, out, false)
+ fmt.Fprint(out, "</p>")
+ }
case colStyleHeader, colStyleVerse:
fmt.Fprintf(out, "<p class=%q>%s</p>",