Skip to content

Fix regression with regard to quotes in attribute values

Jonathan Neuhauser requested to merge github/fork/mfwitten/escape-quotes/00 into master

Created by: mfwitten

The following commit removed the escaping of single quotes and double quotes, in order to fix issues #21 (closed) and #56 (closed):

    commit 57f93efc
    Date: Tue Aug 16 00:10:41 2016 +0200

However, this broke the quoting of an attribute value that has both a single quote and a double quote. This patch series re-introduces the escaping of quotes, but ultimately uses entities only when both a single quote and a double quote are present at the same time in an attribute value; whether single quotes or double quotes are escaped depends on which choice produces the shortest result. Unit tests are included.

I didn't find out about issue #21 (closed) or #56 (closed) until just now, so it might be worthwhile to include tests for those situations before proceeding.

Merge request reports

Loading