[wp-meta] [Making WordPress.org] #6602: Comment previews can be inaccurate when they contain back slashes.

Making WordPress.org noreply at wordpress.org
Mon Nov 28 04:57:11 UTC 2022


#6602: Comment previews can be inaccurate when they contain back slashes.
--------------------------------------+--------------------
 Reporter:  peterwilsoncc             |      Owner:  (none)
     Type:  defect (bug)              |     Status:  new
 Priority:  normal                    |  Milestone:
Component:  Make (Get Involved) / P2  |   Keywords:
--------------------------------------+--------------------
 On make/core I needed to leave a comment containing some regex:
 `/\*{1}\n`.

 When viewing the comment using the preview tab, the above was displaying
 as `/*{1}n`, for the preview to display the code correctly I modified it
 to `/\\*{1}\\n`.

 When submitting the comment, the comment was rendered as entered with the
 double back slashes.

 I suspect it's a JavaScript escaping issue when rendering the preview. I
 was wrapping the regex in `<code>` tags in case that makes a difference --
 while testing it doesn't seem to.

 (Aside: I know the `{1}` isn't required but I was including it to make a
 distinction :)

-- 
Ticket URL: <https://meta.trac.wordpress.org/ticket/6602>
Making WordPress.org <https://meta.trac.wordpress.org/>
Making WordPress.org


More information about the wp-meta mailing list