HTML / escape / context boundary

Separate HTML escaping contexts

Review text, attribute and URL contexts separately, including quote and entity boundaries. No real HTML or script is handled; only a local review note is produced.

Five context boundaries

Treating HTML escaping as one conversion can mix display, attribute and URL destinations. Record the output context and its allowed conditions separately.

text ≠ attribute ≠ URL / classify → escape → verify
ContextReview
textDisplay a value without interpreting it as HTML.
attributeKeep quote boundaries closed so the value cannot leave the attribute.
URLCheck HTML escaping separately from the allowed scheme and URL policy.
quoteReview single quotes, double quotes and ampersands separately.
entityDo not mix a displayed character with its destination context.

Safe review order

  1. Classify the destination as text, attribute or URL.
  2. Review quote and entity boundaries with synthetic examples.
  3. Check allowed URL schemes separately from HTML escaping.
  4. Approve the note before returning to any script context.

This page does not parse or execute real HTML and accepts no user input. It uses synthetic cases only.

Six synthetic cases

caseresult
text-contextText context
attribute-contextAttribute context
url-contextURL context
quote-boundaryQuote boundary
entity-referenceEntity reference
unsupported-script-contextReject