Format context item markdown on view page
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3575595. -->
Reported by: [kristen pol](https://www.drupal.org/user/8389)
Related to !74
>>>
<p>[Tracker]<br>
<strong>Update Summary: </strong>[One-line status update for stakeholders]<br>
<strong>Check-in Date: </strong>MM/DD/YYYY<br>
<strong>Blocked by: </strong>[#XXXXXX] (New issues on new lines)<br>
<strong>Additional Collaborators: </strong> @username1, @username2<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>The context item view page shows unformatted markdown if markdown text is used rather than showing it formatted.</p>
<p>It would be nice if the text were formatted.</p>
<p><img src="https://www.drupal.org/files/issues/2026-02-24/ccc-unformatted-context-markdown.png" alt="ccc context item with unformatted markdown text"></p>
<h3 id="summary-proposed-resolution">Proposed resolution</h3>
<p>Artem mentioned the markdown filter module, but we already have a lot of dependencies.</p>
<p>Marcus mentioned league/commonmark is recommended to be installed by the AI module, but not a dependency:</p>
<p><a href="https://commonmark.thephpleague.com/">https://commonmark.thephpleague.com/</a></p>
<h3 id="summary-remaining-tasks">Target date or deadline</h3>
<p>March 2026</p>
<h3 id="summary-remaining-tasks">Remaining tasks</h3>
<ul>
<li>Choose an approach</li>
<li>Update code</li>
<li>Review and test</li>
</ul>
<h3 id="how-to-test">How to test</h3>
<p>Follow the <a href="https://www.drupal.org/project/ai_context#install-testing-steps">installation and testing steps on the project page</a> and try on Drupal 11 and Drupal CMS 2.0.</p>
<p>When creating a context item, add markdown to the content.</p>
<p>After creating a context item, go to the view page for the context item: </p>
<p><code>/admin/ai/context/items/[id]</code></p>
<p>Example:</p>
<p><code>/admin/ai/context/items/1</code></p>
<p>And, check that the markdown looks okay.</p>
<p>You can also configure your context item with context scope and see if it shows up correctly.</p>
<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>[x] 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>
issue