András Simonyi <[email protected]> writes: >> The >> issue I have is with the function `org-cite-csl-render-bibliography': >> it should not output <style> elements because when one exports an >> org-mode document > > Thanks for reporting! Unfortunately, I'm not well-versed enough in > HTML matters to assess how norm violating the current behaviour is, > but I'm attaching a tentative patch which moves the CSL-related CSS > fragment to the head of the exported HTML using the same mechanism > that was injecting the CSL-related LaTeX preamble. Comments on whether > we should change the current behaviour and the concrete implementation > in the patch are welcome! > ... > + (let ((insert-part (lambda (anchor part) > + (with-temp-buffer > + (save-excursion (insert output)) > + (when (search-forward anchor nil t) > + (goto-char (match-beginning 0)) > + ;; Insert the CSL-specific parts. > + (insert part)) > + (buffer-string))))) > + (pcase output-format > + ('html > + (funcall insert-part "</style>" (org-cite-csl--generate-html-head > info)))
This looks fishy to me. There is no guarantee that </style> is always included into the exported HTML, so your code may not always add style. I suspect that a more robust approach could be adding to :html-head. CCing Timothy as he should know these things better. -- Ihor Radchenko // yantar92, Org mode maintainer, Learn more about Org mode at <https://orgmode.org/>. Support Org development at <https://liberapay.com/org-mode>, or support my work at <https://liberapay.com/yantar92>
