Move league/commonmark as optional dependency
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3484985. --> Reported by: [mglaman](https://www.drupal.org/user/2416470) Related to !250 >>> <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>I'm evaluating the AI module. I'm concerned about it's dependency tree.</p> <pre>Gathering patches for dependencies. This might take a minute.<br>&nbsp; - Installing yethee/tiktoken (0.5.1): Extracting archive<br>&nbsp; - Installing league/html-to-markdown (5.1.1): Extracting archive<br>&nbsp; - Installing nette/utils (v4.0.5): Extracting archive<br>&nbsp; - Installing nette/schema (v1.3.2): Extracting archive<br>&nbsp; - Installing league/config (v1.2.0): Extracting archive<br>&nbsp; - Installing league/commonmark (2.5.3): Extracting archive<br>&nbsp; - Installing drupal/key (1.19.0): Extracting archive<br>&nbsp; - Installing drupal/ai (1.0.0-beta1): Extracting archive</pre><p>Due to <code>league/commonmark</code> the following extra dependencies are added:</p> <ul> <li><code>league/config</code></li> <li><code>nette/schema</code></li> <li><code>nette/utils</code></li> </ul> <p>This is all for the <code>AiSearchIndexFieldsForm</code> class supporting Search API, and it looks mostly informative for administrative users. It's also for a submodule which may not be used, but is added as a root dependency since Drupal.org doesn't perform subtree splits for submodules.</p> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <p>Move <code>league/commonmark</code> to a <code>suggest</code> to enhance the output of <code>AiSearchIndexFieldsForm</code> In <code>buildCheckerChunkTable</code> there can be a <code>class_exists</code> call. If it exists, instatiate a converter. If not, display a message that "markdown can be displayed as HTML if you add <code>league/commonmark</code>"</p>
issue