-
Notifications
You must be signed in to change notification settings - Fork 4
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
Caption refactor Presentation XML: https://github.com/metanorma/isodo… #618
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some files could not be reviewed due to errors:
Error: RuboCop found unknown Ruby version 3.4 in `TargetRubyVersion` paramete...
Error: RuboCop found unknown Ruby version 3.4 in `TargetRubyVersion` parameter (in .rubocop.yml). Supported versions: 2.4, 2.5, 2.6, 2.7, 3.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some files could not be reviewed due to errors:
Error: RuboCop found unknown Ruby version 3.4 in `TargetRubyVersion` paramete...
Error: RuboCop found unknown Ruby version 3.4 in `TargetRubyVersion` parameter (in .rubocop.yml). Supported versions: 2.4, 2.5, 2.6, 2.7, 3.0
…ry delimiters, clause label processing: #617
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some files could not be reviewed due to errors:
Error: RuboCop found unknown Ruby version 3.4 in `TargetRubyVersion` paramete...
Error: RuboCop found unknown Ruby version 3.4 in `TargetRubyVersion` parameter (in .rubocop.yml). Supported versions: 2.4, 2.5, 2.6, 2.7, 3.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some files could not be reviewed due to errors:
Error: RuboCop found unknown Ruby version 3.4 in `TargetRubyVersion` paramete...
Error: RuboCop found unknown Ruby version 3.4 in `TargetRubyVersion` parameter (in .rubocop.yml). Supported versions: 2.4, 2.5, 2.6, 2.7, 3.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some files could not be reviewed due to errors:
Error: RuboCop found unknown Ruby version 3.4 in `TargetRubyVersion` paramete...
Error: RuboCop found unknown Ruby version 3.4 in `TargetRubyVersion` parameter (in .rubocop.yml). Supported versions: 2.4, 2.5, 2.6, 2.7, 3.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some files could not be reviewed due to errors:
Error: RuboCop found unknown Ruby version 3.4 in `TargetRubyVersion` paramete...
Error: RuboCop found unknown Ruby version 3.4 in `TargetRubyVersion` parameter (in .rubocop.yml). Supported versions: 2.4, 2.5, 2.6, 2.7, 3.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some files could not be reviewed due to errors:
Error: RuboCop found unknown Ruby version 3.4 in `TargetRubyVersion` paramete...
Error: RuboCop found unknown Ruby version 3.4 in `TargetRubyVersion` parameter (in .rubocop.yml). Supported versions: 2.4, 2.5, 2.6, 2.7, 3.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some files could not be reviewed due to errors:
Error: RuboCop found unknown Ruby version 3.4 in `TargetRubyVersion` paramete...
Error: RuboCop found unknown Ruby version 3.4 in `TargetRubyVersion` parameter (in .rubocop.yml). Supported versions: 2.4, 2.5, 2.6, 2.7, 3.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some files could not be reviewed due to errors:
Error: RuboCop found unknown Ruby version 3.4 in `TargetRubyVersion` paramete...
Error: RuboCop found unknown Ruby version 3.4 in `TargetRubyVersion` parameter (in .rubocop.yml). Supported versions: 2.4, 2.5, 2.6, 2.7, 3.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some files could not be reviewed due to errors:
Error: RuboCop found unknown Ruby version 3.4 in `TargetRubyVersion` paramete...
Error: RuboCop found unknown Ruby version 3.4 in `TargetRubyVersion` parameter (in .rubocop.yml). Supported versions: 2.4, 2.5, 2.6, 2.7, 3.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some files could not be reviewed due to errors:
Error: RuboCop found unknown Ruby version 3.4 in `TargetRubyVersion` paramete...
Error: RuboCop found unknown Ruby version 3.4 in `TargetRubyVersion` parameter (in .rubocop.yml). Supported versions: 2.4, 2.5, 2.6, 2.7, 3.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some files could not be reviewed due to errors:
Error: RuboCop found unknown Ruby version 3.4 in `TargetRubyVersion` paramete...
Error: RuboCop found unknown Ruby version 3.4 in `TargetRubyVersion` parameter (in .rubocop.yml). Supported versions: 2.4, 2.5, 2.6, 2.7, 3.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some files could not be reviewed due to errors:
Error: RuboCop found unknown Ruby version 3.4 in `TargetRubyVersion` paramete...
Error: RuboCop found unknown Ruby version 3.4 in `TargetRubyVersion` parameter (in .rubocop.yml). Supported versions: 2.4, 2.5, 2.6, 2.7, 3.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some files could not be reviewed due to errors:
Error: RuboCop found unknown Ruby version 3.4 in `TargetRubyVersion` paramete...
Error: RuboCop found unknown Ruby version 3.4 in `TargetRubyVersion` parameter (in .rubocop.yml). Supported versions: 2.4, 2.5, 2.6, 2.7, 3.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some files could not be reviewed due to errors:
Error: RuboCop found unknown Ruby version 3.4 in `TargetRubyVersion` paramete...
Error: RuboCop found unknown Ruby version 3.4 in `TargetRubyVersion` parameter (in .rubocop.yml). Supported versions: 2.4, 2.5, 2.6, 2.7, 3.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some files could not be reviewed due to errors:
Error: RuboCop found unknown Ruby version 3.4 in `TargetRubyVersion` paramete...
Error: RuboCop found unknown Ruby version 3.4 in `TargetRubyVersion` parameter (in .rubocop.yml). Supported versions: 2.4, 2.5, 2.6, 2.7, 3.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some files could not be reviewed due to errors:
Error: RuboCop found unknown Ruby version 3.4 in `TargetRubyVersion` paramete...
Error: RuboCop found unknown Ruby version 3.4 in `TargetRubyVersion` parameter (in .rubocop.yml). Supported versions: 2.4, 2.5, 2.6, 2.7, 3.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some files could not be reviewed due to errors:
Error: RuboCop found unknown Ruby version 3.4 in `TargetRubyVersion` paramete...
Error: RuboCop found unknown Ruby version 3.4 in `TargetRubyVersion` parameter (in .rubocop.yml). Supported versions: 2.4, 2.5, 2.6, 2.7, 3.0
@@ -5,7 +5,8 @@ | |||
def citeas(xmldoc) | |||
xmldoc.xpath(ns("//eref | //origin | //quote//source")).each do |e| | |||
e["bibitemid"] && e["citeas"] or next | |||
a = @xrefs.anchor(e["bibitemid"], :xref, false) and e["citeas"] = a | |||
a = @xrefs.anchor(e["bibitemid"], :xref, false) and | |||
e["citeas"] = a.gsub(%r{</?[^>]+>}, "") |
Check failure
Code scanning / CodeQL
Incomplete multi-character sanitization High
<script
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix AI 2 months ago
To fix the problem, we need to ensure that all instances of the targeted pattern are removed from the input string. One effective way to achieve this is to apply the regular expression replacement repeatedly until no more replacements can be performed. This ensures that any remaining unsafe text is completely removed.
We will modify the citeas
method to repeatedly apply the gsub
replacement until the input string no longer changes. This approach guarantees that all HTML tags are removed, preventing any potential HTML element injection vulnerabilities.
-
Copy modified line R9 -
Copy modified lines R11-R22
@@ -8,4 +8,16 @@ | ||
a = @xrefs.anchor(e["bibitemid"], :xref, false) and | ||
e["citeas"] = a.gsub(%r{</?[^>]+>}, "") | ||
e["citeas"] = remove_html_tags(a) | ||
end | ||
end | ||
end | ||
|
||
private | ||
|
||
def remove_html_tags(input) | ||
previous = nil | ||
while input != previous | ||
previous = input | ||
input = input.gsub(%r{</?[^>]+>}, "") | ||
end | ||
input | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some files could not be reviewed due to errors:
Error: RuboCop found unknown Ruby version 3.4 in `TargetRubyVersion` paramete...
Error: RuboCop found unknown Ruby version 3.4 in `TargetRubyVersion` parameter (in .rubocop.yml). Supported versions: 2.4, 2.5, 2.6, 2.7, 3.0
…n Presentation XML: #617
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some files could not be reviewed due to errors:
Error: RuboCop found unknown Ruby version 3.4 in `TargetRubyVersion` paramete...
Error: RuboCop found unknown Ruby version 3.4 in `TargetRubyVersion` parameter (in .rubocop.yml). Supported versions: 2.4, 2.5, 2.6, 2.7, 3.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some files could not be reviewed due to errors:
Error: RuboCop found unknown Ruby version 3.4 in `TargetRubyVersion` paramete...
Error: RuboCop found unknown Ruby version 3.4 in `TargetRubyVersion` parameter (in .rubocop.yml). Supported versions: 2.4, 2.5, 2.6, 2.7, 3.0
…n Presentation XML: #617
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some files could not be reviewed due to errors:
Error: RuboCop found unknown Ruby version 3.4 in `TargetRubyVersion` paramete...
Error: RuboCop found unknown Ruby version 3.4 in `TargetRubyVersion` parameter (in .rubocop.yml). Supported versions: 2.4, 2.5, 2.6, 2.7, 3.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some files could not be reviewed due to errors:
Error: RuboCop found unknown Ruby version 3.4 in `TargetRubyVersion` paramete...
Error: RuboCop found unknown Ruby version 3.4 in `TargetRubyVersion` parameter (in .rubocop.yml). Supported versions: 2.4, 2.5, 2.6, 2.7, 3.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some files could not be reviewed due to errors:
Error: RuboCop found unknown Ruby version 3.4 in `TargetRubyVersion` paramete...
Error: RuboCop found unknown Ruby version 3.4 in `TargetRubyVersion` parameter (in .rubocop.yml). Supported versions: 2.4, 2.5, 2.6, 2.7, 3.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some files could not be reviewed due to errors:
Error: RuboCop found unknown Ruby version 3.4 in `TargetRubyVersion` paramete...
Error: RuboCop found unknown Ruby version 3.4 in `TargetRubyVersion` parameter (in .rubocop.yml). Supported versions: 2.4, 2.5, 2.6, 2.7, 3.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some files could not be reviewed due to errors:
Error: RuboCop found unknown Ruby version 3.4 in `TargetRubyVersion` paramete...
Error: RuboCop found unknown Ruby version 3.4 in `TargetRubyVersion` parameter (in .rubocop.yml). Supported versions: 2.4, 2.5, 2.6, 2.7, 3.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some files could not be reviewed due to errors:
Error: RuboCop found unknown Ruby version 3.4 in `TargetRubyVersion` paramete...
Error: RuboCop found unknown Ruby version 3.4 in `TargetRubyVersion` parameter (in .rubocop.yml). Supported versions: 2.4, 2.5, 2.6, 2.7, 3.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some files could not be reviewed due to errors:
Error: RuboCop found unknown Ruby version 3.4 in `TargetRubyVersion` paramete...
Error: RuboCop found unknown Ruby version 3.4 in `TargetRubyVersion` parameter (in .rubocop.yml). Supported versions: 2.4, 2.5, 2.6, 2.7, 3.0
…c/issues/617
Metanorma PR checklist