Skip to content

Commit

Permalink
Allow non-paragraph elements in Textblock
Browse files Browse the repository at this point in the history
  • Loading branch information
pgundlach committed Jan 19, 2024
1 parent 01dc0e2 commit 1b35274
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions core/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -1747,6 +1747,21 @@ func cmdTextblock(xd *xtsDocument, layoutelt *goxml.Element) (xpath.Sequence, er
for i, itm := range seq {
te := frontend.NewText()
switch t := itm.(type) {
case *goxml.Element:
n, err := xd.parseHTMLText(t.ToXML())
if err != nil {
return nil, err
}
vlistFormatter, err := xd.decodeHTMLFromHTMLNode(n)
if err != nil {
return nil, newTypesettingError(err)
}
vl, err := vlistFormatter(attValues.Width)
if err != nil {
return nil, newTypesettingError(fmt.Errorf("Textblock (line %d): %w", layoutelt.Line, err))
}
te.Items = append(te.Items, vl)

case *html.Node:
doc := &html.Node{
Type: html.DocumentNode,
Expand Down

0 comments on commit 1b35274

Please sign in to comment.