Top-level article title/body not added when publishing Markdown topic to HTML5

Post here questions and problems related to editing and publishing DITA content.
chrispitude
Posts: 922
Joined: Thu May 02, 2019 2:32 pm

Top-level article title/body not added when publishing Markdown topic to HTML5

Post by chrispitude »

I have the following Markdown topic, which has title metadata instead of an explicit top-level header:

Code: Select all

---
title: My Topic
---

This topic covers:

- X
- Y

## About X
Here is some information on X.

## About Y
Here is some information on Y.
The open-source DITA-OT 4.1.2 publishes this to HTML5 as follows:

Code: Select all

<body>
  <main role="main">
    <article role="article" aria-labelledby="ariaid-title1">
      <article class="nested0" aria-labelledby="ariaid-title1" id="my-topic">
        <h1 class="title topictitle1" id="ariaid-title1">My Topic</h1>
   <!-- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -->
        <div class="body">
   <!-- ^^^^^^^^^^^^^^^^^^ -->
          <p class="p">This topic covers:</p>
          <ul class="ul">
            <li class="li">X</li>
            <li class="li">Y</li>
          </ul>
        </div>
      </article>
      <article class="topic nested0" aria-labelledby="ariaid-title2" id="about-x">
        <h2 class="title topictitle1" id="ariaid-title2">About X</h1>
        <div class="body">
          <p class="p">Here is some information on X.</p>
        </div>
      </article>
      <article class="topic nested0" aria-labelledby="ariaid-title3" id="about-y">
        <h2 class="title topictitle1" id="ariaid-title3">About Y</h1>
        <div class="body">
          <p class="p">Here is some information on Y.</p>
        </div>
      </article>
    </article>
  </main>
</body>
Note that the open-source DITA-OT infers the top-level <title> and <div class="body"> so that the output is consistent with a published DITA topic.

When I publish this same Markdown topic to HTML5 with Oxygen Publishing Engine 2024041900, which is based on DITA-OT 4.1.2, these components are missing:

Code: Select all

<body>
  <main role="main">
    <article role="article" aria-labelledby="">
      <p class="p">This topic covers:</p>
      <ul class="ul">
        <li class="li">X</li>
        <li class="li">Y</li>
      </ul>
      <article class="topic nested0" aria-labelledby="ariaid-title1" id="about-x">
        <h1 class="title topictitle1" id="ariaid-title1">About X</h1>
        <div class="body">
          <p class="p">Here is some information on X.</p>
        </div>
      </article>
      <article class="topic nested0" aria-labelledby="ariaid-title2" id="about-y">
        <h1 class="title topictitle1" id="ariaid-title2">About Y</h1>
        <div class="body">
          <p class="p">Here is some information on Y.</p>
        </div>
      </article>
    </article>
  </main>
</body>
This causes the Markdown-to-HTML content structure to differ from DITA-to-HTML content structure, which causes errors in downstream content processing.

Is this intentional or a bug? Can it be fixed/controlled for the next release of Oxygen and the Oxygen Publishing Engine?

Thanks!
Radu
Posts: 9431
Joined: Fri Jul 09, 2004 5:18 pm

Re: Top-level article title/body not added when publishing Markdown topic to HTML5

Post by Radu »

Hi Chris,

Thanks for the problem report, I added an internal issue for it, pasting the issue ID below for future reference:
EXM-54624 Markdown to DITA converter does not take yaml title into account

Indeed we have some patches made to the Markdown to DITA converter developed by Jarno Eolvirta which attempt to fix certain heading-related problems (for example starting the Markdown with h2 instead of h1) and in this case the patch seems to break the functionality.

There is an Oxygen specific plugin "DITA-OT/plugins/com.oxygenxml.dynamic.resources.converter", if you remove it and re-integrate or rename its plugin.xml and re-integrate, our conversion related patches should no longer work. Besides influencing the Markdown to DITA conversion our plugin does some extra stuff but you probably do not need it:
https://www.oxygenxml.com/doc/versions/ ... _dita.html

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply