seboettg / citeproc-php

Full-featured CSL 1.0.1 processor for PHP
MIT License
76 stars 39 forks source link

Is rich text formatting supported in titles ? #156

Open glorieux-f opened 1 year ago

glorieux-f commented 1 year ago

Please follow the general troubleshooting steps first:

Bug reports:

Zotero support some rich text formatting for titles in bibliography.

"title": "Not closing <b> or <strong>unknown tag</strong>, kept as text ; <i>italic rendered</i>"

Zotero desktop client bibliography as HTML

<div class="csl-entry">
   <i>Not closing &lt;b&gt; or &lt;strong&gt;unknown tag&lt;/strong&gt;, kept as text ;
      <span style="font-style:normal;">italic rendered</span></i>
 (s. d.).</div>

citeproc-php

<div class="csl-entry">
    <i>Not closing &lt;b&gt; or &lt;strong&gt;unknown tag&lt;/strong&gt;, kept as text; 
    &lt;i&gt;italic rendered&lt;/i&gt;</i>.
 (s. d.).</div>

I’ve been advised by @dstillman about that, there is a special tagsoup parser in Zotero https://github.com/zotero/zotero/blob/main/chrome/content/zotero/itemTree.jsx#L2610

As a quick fix, I use your “additionalMarkup” hook, but not with a full tagsoup parser.

Used CSL stylesheet:

apa.csl

Used CSL metadata

[
    {
    "id": "http://zotero.org/users/8989645/items/8WEPW7QK",
    "type": "article-journal",
    "title": "Not closing <b> or <strong>unknown tag</strong>, kept as text; <i>italic rendered</i>"
    }
]