Skip to content

Conversation

@mcanouil
Copy link
Collaborator

@mcanouil mcanouil commented Dec 28, 2025

Correct the processing of license metadata to ensure proper handling of inline license elements.

The typo prevented from using license.text in template/partials/shortcodes when license: "my license" was used.

Note that version is not added to "text" for CC0 licenses because for some reason, the URL/parsing is created in TypeScript for this license.

---
format: html
license: "Whatever"
---

{{< meta license.text >}}
---
format: html
license: "CC BY"
---

{{< meta license.text >}}
---
format: html
license: "CC0"
---

{{< meta license.text >}}

@mcanouil mcanouil self-assigned this Dec 28, 2025
@posit-snyk-bot
Copy link
Collaborator

posit-snyk-bot commented Dec 28, 2025

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@mcanouil mcanouil changed the title fix: correct license metadata processing fix(license.lua): correct license metadata lua processing Dec 28, 2025
@mcanouil mcanouil marked this pull request as draft December 28, 2025 13:29
@mcanouil mcanouil marked this pull request as ready for review December 29, 2025 18:35
Copy link
Collaborator

@cderv cderv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the change!

Honestly, I don't think this is a typo - text was just not set initially.

Then it was added for the typescript part in #6784.

So this change is an improvement to make inline CC license having a default text, exactly like with the appendix part.

This is good ! Another oversight is the the support for CC0 that was added only on the TS part too: #10763

---
format: html
license: "CC0"
---

License: {{< meta license.text >}}

so it won't be CC0 1.0 like the link
image

Also, I checked the template for which those meta are used. I think this is fine to add such text. Only JATS seems to use this licence in template. And <license-p> seems to support this text for CC too https://jats.nlm.nih.gov/publishing/tag-library/1.3/element/license-p.html

@mcanouil
Copy link
Collaborator Author

mcanouil commented Jan 5, 2026

FWIW, the context was for my Typst template, I wanted to show license/copyright, but this prevented it and generally it prevented anyone to use it as part of their template.

@cderv
Copy link
Collaborator

cderv commented Jan 5, 2026

Thanks for the context, that it helpful to understand ! I'll merge this today

@mcanouil
Copy link
Collaborator Author

mcanouil commented Jan 5, 2026

And yes, CC0 is not accounted for as it would require more thinking and possibly refactoring to move it to Lua with other license processing. Maybe worth opening an enhancement issue for "future"?

@mcanouil
Copy link
Collaborator Author

mcanouil commented Jan 5, 2026

The typo I was referring to is (the brackets should not be there):

The other changes are only for CC licenses.

@cderv cderv merged commit 0e5964c into quarto-dev:main Jan 5, 2026
51 checks passed
@mcanouil mcanouil deleted the fix/license-lua-processing branch January 5, 2026 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants