AEM Guides: la generazione del sito non riesce quando xref utilizza mailto:# nel collegamento
Questo articolo risolve un errore di generazione del sito in Adobe Experience Manager Guides quando un riferimento xr contiene un collegamento mailto che inizia con il carattere #.
Descrizione description
Ambiente
Adobe Experience Manager Guides (tutte le versioni)
Problema/Sintomi
Quando si genera l’output di AEM Sites utilizzando i predefiniti, il processo non riesce se un elemento xref contiene un collegamento mailto che inizia con il carattere # (ad esempio: mailto:#example@example.com).
Durante la generazione del sito si verifica il seguente errore:
BUILD FAILED
/mnt/crx/author/crx-quickstart/profiles/ditaot--<profile-id>/DITA-OT/plugins/org.dita.base/build_preprocess.xml:62:
Failed to run pipeline: Expected scheme-specific part at index 7: mailto:#example@example.com
- Il problema è riproducibile aggiungendo un riferimento incrociato con
mailto:#in qualsiasi argomento e tentando di generare l’output di AEM Sites. - L’errore si verifica durante il passaggio di preelaborazione DITA-OT.
Per ulteriore contesto, vedere Documentazione sugli indirizzi basati su URI DITA:
Risoluzione resolution
-
Aggiornare l’elemento xref per utilizzare la codifica percentuale per il carattere #.
Invece di utilizzare<xref>mailto:#example@example.com</xref>, codificare il # come%23.Ad esempio:
code language-none <xref href="mailto:%23example@example.com" format="html">Contact Support</xref>
2. Ensure the xref uses the href attribute and includes display text.
This helps DITA-OT correctly interpret the link as an external reference.
3.Save the topic and regenerate the AEM Sites output using Presets.The site generation should now complete successfully without errors.
Cause
The DITA-OT processor interprets the # character as a fragment identifier within URIs. When used directly in a mailto link, it causes URI parsing errors. Percent-encoding the # character as %23 allows DITA-OT to process the link as intended.