[DRE-maint] Bug#1084777: broken conversion of emphasis + superscript to docbook xml

Osamu Aoki osamu at debian.org
Tue Oct 8 06:36:36 BST 2024


Source: asciidoctor
Version: 2.0.23-1
Severity: normal
Tags: upstream

As reported to the upstream:
https://github.com/asciidoctor/asciidoctor/issues/4628

I found this problem when using asciidoctor for `debamake-doc` package.
In this sense, I really used current sid environment (2.0.31-1) too.

== From my upstream bug report ==

I used asciidoctor (2 versions are tested: docker image=2.0.23 and Debian/stable=2.0.18) for test and I encounter the following broken output for DocBook while HTML doesn't suffer this problem. See below for test sample data, buggy result, and Makefile to reproduce bug.

Input file (test.asc):

```
// vim:set filetype=asciidoc:
= TEST

* B^SUPER^E
* B**^SUPER^**E
* B^*SUPER*^E
* B^**SUPER**^E
```

DocBook conversion result below (the first 2 itemized lines are good, the last 2 itemized lines are bad):

```
<?xml version="1.0" encoding="UTF-8"?>
<?asciidoc-toc?>
<?asciidoc-numbered?>
<book xmlns="http://docbook.org/ns/docbook" xmlns:xl="http://www.w3.org/1999/xlink" version="5.0" xml:lang="en">
<info>
<title>TEST</title>
<date>2024-10-01</date>
</info>
<preface>
<title></title>
<itemizedlist>
<listitem>
<simpara>B<superscript>SUPER</superscript>E</simpara>
</listitem>
<listitem>
<simpara>B<emphasis role="strong"><superscript>SUPER</superscript></emphasis>E</simpara>
</listitem>
<listitem>
<simpara>B^<emphasis role="strong">SUPER</emphasis>^E</simpara>
</listitem>
<listitem>
<simpara>B^<emphasis role="strong">SUPER</emphasis>^E</simpara>
</listitem>
</itemizedlist>
</preface>
</book>
```
You see non-converted-`^`s.

HTML page doesn't have this problem.

FYI: My `Makefile` :
```
ASCIIDOC := podman run -it -v .:/documents/ \
  docker.io/asciidoctor/docker-asciidoctor asciidoctor
DOCNAME := test
all: test.html test.xml

clean:
	rm -rf *.xml *.html


%.xml: %.asc
	$(ASCIIDOC) --doctype book\
		-b docbook \
		-a 'newline=\n' \
		$<

%.html: %.asc
	$(ASCIIDOC) --doctype book\
		-b html \
		-a toc2 \
		-a 'newline=\n' \
		$<
```



-- System Information:
Debian Release: 12.7
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 6.5.0-0.deb12.4-amd64 (SMP w/12 CPU threads; PREEMPT)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en_US:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled



More information about the Pkg-ruby-extras-maintainers mailing list