ruby-rdf / rdf-turtle

Turtle reader/writer for Ruby
http://rubygems.org/gems/rdf-turtle
The Unlicense
31 stars 9 forks source link

Escape all instances of `"` in `"""` delimited literals #17

Closed no-reply closed 5 years ago

no-reply commented 5 years ago

Fixes two bugs associated with """ delimited literals.

First: such literals cannot end with a " (see STRING_LITERAL_LONG_QUOTE at https://www.w3.org/TR/turtle/#sec-grammar-grammar).

Second: they cannot contain a sequence of three ". The prior .gsub('"""', '\"""') approach addresses this for cases where " appears in multiples of three, but fails for other cases (e.g. """").

Both bugs are fixed by escaping all " characters.

An alternative addressing only the second bug might be: .gsub('"""', '\""\"'), which would ensure three quotes aren't ever left in a row.

Closes #16.

coveralls commented 5 years ago

Coverage Status

Coverage increased (+0.08%) to 96.279% when pulling 6c90d469cff917d2b2acbc7eec523f9a71f32fd3 on escape-quotes-in-multi-line into b382c8e0d3b2698d631d0185acd07c1f110938f5 on develop.

coveralls commented 5 years ago

Coverage Status

Coverage increased (+0.08%) to 96.279% when pulling 6c90d469cff917d2b2acbc7eec523f9a71f32fd3 on escape-quotes-in-multi-line into b382c8e0d3b2698d631d0185acd07c1f110938f5 on develop.

gkellogg commented 5 years ago

Thanks Tom, there was a N3 serialization test that prompted the last change, and we may need a further tweak, but let’s go with this for now.

no-reply commented 5 years ago

Yeah, I'm pretty sure this is an improvement, but I did feel a little anxious that there might be a pile of edge cases.

no-reply commented 5 years ago

What do you think about a bugfix release with this?

I could probably push one out later tonight or in the morning.

gkellogg commented 5 years ago

It would be great if you would, I’m still in Washington after a JSON-LD WG meeting.

Been spending a bunch of time on n3 reasoning, too.

Gregg Kellogg Sent from my iPhone

On Feb 8, 2019, at 7:10 PM, Tom Johnson notifications@github.com wrote:

What do you think about a bugfix release with this?

I could probably push one out later tonight or in the morning.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or mute the thread.