Skip to content

Main content

Typographic Quote Nesting Pair Tool

Calculate typographic quote nesting pair from explicit caller-supplied inputs.

Loading tool…

Description

Alternate curly double and single opening/closing quotes by nonnegative integer depth, with doubleOuter selecting which pair appears at even depth.

Text positions can be measured in UTF-16 code units, Unicode code points, grapheme clusters, or modeled display columns. These coordinates are not interchangeable. Invisible markers and delimiter policies can also affect interpretation even when a string looks unchanged, so the chosen representation needs to stay explicit.

Alternate curly double and single opening/closing quotes by nonnegative integer depth, with doubleOuter selecting which pair appears at even depth.

When to use this tool

Use Typographic Quote Nesting Pair when you need the stated marker, coordinate, delimiter, or normalization operation under an explicit text representation.

How to use the tool and how it works

  1. Enter depth, doubleOuter. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. Read opening, closing. Use the output convention below.

Alternate curly double and single opening/closing quotes by nonnegative integer depth, with doubleOuter selecting which pair appears at even depth.1

Input fieldMeaning and unitsAccepted input
depthDepthRequired. Safe integer; minimum 0.
doubleOuterDouble OuterRequired. Boolean.
Output fieldInterpretationReturned shape
openingOpeningRequired. Text; maximum UTF-16 length 8192.
closingClosingRequired. Text; maximum UTF-16 length 8192.
json
{
  "input": {
    "depth": 1,
    "doubleOuter": true
  },
  "output": {
    "opening": "‘",
    "closing": "’"
  }
}

Limitations and assumptions

  • This is a supplied two-style nesting convention. It does not parse quotations, choose locale-specific punctuation, balance a document, or replace straight quotes in context.
  • The field tables state structural bounds; the mechanics also specify cross-field constraints. Malformed inputs and unsupported domains cause errors. A successful false flag, empty branch value, or zero placeholder has the meaning stated above and is distinct from an input error.

Alternative or Complementary methods

Choose the coordinate system required by the consumer. Use a full parser, renderer, or segmentation method when a local marker or delimiter rule cannot determine the complete text behavior.

References

  1. Calculation and input contract: text/typographic-quote-nesting-pair — tool.io

Similar or alternative tools

  • Markdown Link Title Quote Delimiter

    Choose double quotes for a title without them, single quotes when double quotes occur but single quotes do not, or parentheses when both occur.

  • Quotation Mark Nesting Role

    Apply explicit quote-token roles and a supplied symmetric-quote policy without guessing linguistic nesting.