-
Notifications
You must be signed in to change notification settings - Fork 6
Add validation for invalid html tags #244
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
Open
berroar
wants to merge
9
commits into
main
Choose a base branch
from
add-html-validation
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
47293f2
Add validation for invalid html tags
berroar e57eb81
PR comments
berroar e7c136f
Lint
berroar 51deeeb
Raw string
berroar a5e64e2
Double anchor
berroar 3e36e07
Update app/validators/questionnaire_validator.py
berroar 13dc762
Merge branch 'main' into add-html-validation
berroar 6ba6d50
Revert href change
berroar a7bbab5
Merge branch 'main' into add-html-validation
berroar File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
133 changes: 133 additions & 0 deletions
133
tests/schemas/invalid/test_invalid_html_in_schema_text.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,133 @@ | ||
| { | ||
| "mime_type": "application/json/ons/eq", | ||
| "language": "en", | ||
| "schema_version": "0.0.1", | ||
| "data_version": "0.0.3", | ||
| "survey_id": "144", | ||
| "theme": "default", | ||
| "title": "Test invalid html", | ||
| "legal_basis": "Notice is given under section 999 of the Test Act 2000", | ||
| "metadata": [ | ||
| { | ||
| "name": "user_id", | ||
| "type": "string" | ||
| }, | ||
| { | ||
| "name": "period_id", | ||
| "type": "string" | ||
| }, | ||
| { | ||
| "name": "ru_name", | ||
| "type": "string" | ||
| }, | ||
| { | ||
| "name": "ru_ref", | ||
| "type": "string" | ||
| }, | ||
| { | ||
| "name": "trad_as", | ||
| "type": "string", | ||
| "optional": true | ||
| } | ||
| ], | ||
| "questionnaire_flow": { | ||
| "type": "Linear", | ||
| "options": {} | ||
| }, | ||
| "sections": [ | ||
| { | ||
| "id": "introduction-section", | ||
| "title": "Introduction", | ||
| "groups": [ | ||
| { | ||
| "id": "introduction-group", | ||
| "title": "General Business Information", | ||
| "blocks": [ | ||
| { | ||
| "id": "introduction", | ||
| "type": "Introduction", | ||
| "primary_content": [ | ||
| { | ||
| "id": "business-details", | ||
| "title": "Introduction with valid and invalid HTML", | ||
| "contents": [ | ||
| { | ||
| "guidance": { | ||
| "contents": [ | ||
| { | ||
| "title": "<invalid>Coronavirus (COVID-19) guidance</invalid>", | ||
| "description": "<strong>Explain your figures</strong> in the comment section to minimise us contacting you and to help us tell an industry story" | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| "type": "Interstitial", | ||
| "id": "intersitital-one", | ||
| "content": { | ||
| "title": "Page with invalid html", | ||
| "contents": [ | ||
| { | ||
| "description": "<p>You have successfully completed this section<p>" | ||
| } | ||
| ] | ||
| } | ||
| }, | ||
| { | ||
| "type": "Interstitial", | ||
| "id": "interstitial-two", | ||
| "content": { | ||
| "title": "Page with link", | ||
| "contents": [ | ||
| { | ||
| "description": "<a href='link'>Anchor</a>" | ||
| } | ||
| ] | ||
| } | ||
| }, | ||
| { | ||
| "type": "Interstitial", | ||
| "id": "interstitial-three", | ||
| "content": { | ||
| "title": "<strong>Page with mixed invalid tags<strong>", | ||
| "contents": [ | ||
| { | ||
| "description": "<h1>Title</h1><em>Not valid tag</em>" | ||
| } | ||
| ] | ||
| } | ||
| }, | ||
| { | ||
| "type": "Interstitial", | ||
| "id": "interstitial-four", | ||
| "content": { | ||
| "title": "Valid double <strong>strong</strong> with another <strong>strong</strong>.", | ||
petechd marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| "contents": [ | ||
| { | ||
| "description": "<strong>Title</strong><em>Not valid tag</em>" | ||
| } | ||
| ] | ||
| } | ||
| }, | ||
| { | ||
| "type": "Interstitial", | ||
| "id": "interstitial-five", | ||
| "content": { | ||
| "title": "Valid double anchor.", | ||
| "contents": [ | ||
| { | ||
| "description": "<a href='link'>Title</a> and <a href='link-2'>Not valid tag</a>" | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.