Skip to content

[1.x] Merge pull request #1125 from phpDocumentor/feature/sanitize-raw-html #1127

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 11, 2024

Conversation

jaapio
Copy link
Member

@jaapio jaapio commented Oct 11, 2024

Backport

This will backport the following commits from main to 1.x:

Questions ?

Please refer to the Backport tool documentation

jaapio and others added 2 commits October 11, 2024 11:57
This feature introduces a new compiler pass that will allow us to
sanitize the html in a raw directive. We can disable the full raw
usage by setting `raw_node.escape` to `true` this will block all
html and displays the raw node as normal paragraph.

By default the raw directive is displayed as is and sanitized to
safe html, when raw is defined as html content

```
.. raw:: html

   <p>html here</p>
```

if the raw language is different than html we no nothing for now.

This pr also allows the users to define there own html sanitizer
from the configuration. Example can be found in the included test.

(cherry picked from commit ed886fe)

# Conflicts:
#	composer.lock
#	packages/guides/composer.json
(cherry picked from commit 7378a62)
@jaapio jaapio enabled auto-merge October 11, 2024 11:58
@jaapio jaapio merged commit 737e6e6 into 1.x Oct 11, 2024
39 checks passed
@jaapio jaapio deleted the backport/1.x/pr-1125 branch October 11, 2024 12:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants