Skip to content
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

Coderay breaks with embedded backticks #245

Open
vpereira opened this issue Jan 8, 2020 · 0 comments
Open

Coderay breaks with embedded backticks #245

vpereira opened this issue Jan 8, 2020 · 0 comments

Comments

@vpereira
Copy link

vpereira commented Jan 8, 2020

CodeRay crashes with a comment having a quote right after backticks.

I think the culpid is here:

# Converts +id+ to a valid plugin ID String, or returns +nil+.
#
# Raises +ArgumentError+ for all other objects, or if the
# given String includes non-alphanumeric characters (\W).
def validate_id id
case id
when Symbol
id.to_s
when String
if id[/\w+/] == id
id.downcase
else
raise ArgumentError, "Invalid id given: #{id}"
end
else
raise ArgumentError, "Symbol or String expected, but #{id.class} given."
end
end

The string

Invalid id given: '%''{version}'```

can be used to test it as described here: openSUSE/open-build-service#6960

hennevogel added a commit to hennevogel/open-build-service that referenced this issue Jan 10, 2020
CodeRay throws an exception if you give it a language it doesn't find a plugin
for. Reported as rubychan/coderay#245

Fixes openSUSE#6960

Co-authored-by: Dany Marcoux <dmarcoux@suse.com>
hennevogel added a commit to hennevogel/open-build-service that referenced this issue Jan 10, 2020
CodeRay throws an exception if you give it a language it doesn't find a plugin
for. Reported as rubychan/coderay#245

Fixes openSUSE#6960

Co-authored-by: Dany Marcoux <dmarcoux@suse.com>
hennevogel added a commit to hennevogel/open-build-service that referenced this issue Jan 10, 2020
CodeRay throws an exception if you give it a language it doesn't find a plugin
for. Reported as rubychan/coderay#245

Fixes openSUSE#6960

Co-authored-by: Dany Marcoux <dmarcoux@suse.com>
hennevogel added a commit to hennevogel/open-build-service that referenced this issue Jan 15, 2020
CodeRay throws an exception if you give it a language it doesn't find a plugin
for. Reported as rubychan/coderay#245

Fixes openSUSE#6960

Co-authored-by: Dany Marcoux <dmarcoux@suse.com>
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

No branches or pull requests

1 participant