oasis-tcs / sarif-spec

OASIS SARIF TC: Repository for development of the draft standard, where requests for modification should be made via Github Issues
https://github.com/oasis-tcs/sarif-spec
Other
168 stars 47 forks source link

Suspected typo in EXAMPLE 1 of "3.11.6 Messages with embedded links" #656

Open davidmalcolm opened 2 months ago

davidmalcolm commented 2 months ago

"3.11.6 Messages with embedded links" has:

EXAMPLE 1: Consider this embedded link whose link text contains square brackets and backslashes:

"message": {
  "text": "Prohibited term used in [para\\[0\\]\\\\spans\\[2\\](1)."
}

A SARIF viewer would render it as follows:
Prohibited term used in para[0]\spans[2].

Am I right in thinking that within the text property, the embedded link's link text is erroneously not being terminated?

It appears to me that in the string value the \\] after the spans\\[2 in the encoded JSON string is part of the link text, not part of a ]( within this production:

embedded link = "[", link text, "](", link destination, ")";

and thus EXAMPLE 1 is missing a final unescaped ] before the (1); i.e. should:

  "text": "Prohibited term used in [para\\[0\\]\\\\spans\\[2\\](1)."

instead be:

  "text": "Prohibited term used in [para\\[0\\]\\\\spans\\[2\\]](1)."

with that extra ] ?

FWIW, spotted whilst implementing embedded links for GCC output - I tried this example as a unit test; my code is emitting:

  "Prohibited term used in [para\\[0\\]\\\\spans\\[2\\]](1)."

for that example, rather than

  "Prohibited term used in [para\\[0\\]\\\\spans\\[2\\](1)."

from the spec.

dmk42 commented 2 months ago

This does indeed appear to be a typo. Thanks!