Create an HTML to Markdown API and service
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3574246. -->
Reported by: [mxr576](https://www.drupal.org/user/315522)
>>>
<p>[Tracker]<br>
<strong>Update Summary: </strong>[One-line status update for stakeholders]<br>
<strong>Short Description: </strong>[One-line issue summary for stakeholders]<br>
<strong>Check-in Date: </strong>MM/DD/YYYY<br>
<em>Metadata is used by the <a href="https://www.drupalstarforge.ai/" title="AI Tracker">AI Tracker.</a> Docs and additional fields <a href="https://www.drupalstarforge.ai/ai-dashboard/docs" title="AI Issue Tracker Documentation">here</a>.</em><br>
[/Tracker]</p>
<h3 id="summary-problem-motivation">Problem/Motivation</h3>
<p><code>League\HTMLToMarkdown\HtmlConverter</code> is initiated 3 times with 3 different configurations in current code, when <span class="drupalorg-gitlab-issue-link project-issue-status-info project-issue-status-1"><a href="https://www.drupal.org/project/ai/issues/3574004" title="Status: Active">#3574004: Generate a markdown version of (formatted) text field values</a></span> gets solved that becomes the 4th one.</p>
<p><a href="https://git.drupalcode.org/search?search=%22new+HtmlConverter%22&nav_source=navbar&project_id=106525&group_id=2&search_code=true&repository_ref=2.0.x">https://git.drupalcode.org/search?search=%22new+HtmlConverter%22&nav_source=navbar&project_id=106525&group_id=2&search_code=true&repository_ref=2.0.x</a></p>
<h4 id="summary-steps-reproduce">Steps to reproduce (required for bugs, but not feature requests)</h4>
<p>Please provide information like AI modules enabled, which AI provider, browser, etc.</p>
<h3 id="summary-proposed-resolution">Proposed resolution</h3>
<p>A) Simple a preconfigured service from League\HTMLToMarkdown\HtmlConverter<br>
B) Advanced: Create an abstraction for HTML to Markdown conversation so the system would become pluggable for converting HTML to Markdown, similar to Markdownify's own abstraction: <a href="https://git.drupalcode.org/project/markdownify/-/blob/1.1.x/src/HtmlToMarkdownConverterManager.php?ref_type=heads">https://git.drupalcode.org/project/markdownify/-/blob/1.1.x/src/HtmlToMarkdownConverterManager.php?ref_type=heads</a></p>
<h3 id="summary-remaining-tasks">Remaining tasks</h3>
<h3>Optional: Other details as applicable (e.g., User interface changes, API changes, Data model changes)</h3>
<h3 id="summary-ai-usage">AI usage (if applicable)</h3>
<p>[ ] AI Assisted Issue<br>
This issue was generated with AI assistance, but was reviewed and refined by the creator.</p>
<p>[ ] AI Assisted Code<br>
This code was mainly generated by a human, with AI autocompleting or parts AI generated, but under full human supervision.</p>
<p>[ ] AI Generated Code<br>
This code was mainly generated by an AI with human guidance, and reviewed, tested, and refined by a human.</p>
<p>[ ] Vibe Coded<br>
This code was generated by an AI and has only been functionally tested.</p>
> Related issue: [Issue #3574004](https://www.drupal.org/node/3574004)
issue