{
  "articles": "https://thai.news/news/{category}/{slug}",
  "examples": [
    {
      "note": "Paragraph 2 highlight",
      "url": "https://thai.news/news/economy/thailand-18-percent-us-tariff-deal-2027-economic-pivot-expats#p-2"
    },
    {
      "note": "Exact quote highlight: \"18 percent baseline tariff\"",
      "url": "https://thai.news/news/economy/thailand-18-percent-us-tariff-deal-2027-economic-pivot-expats#q=18%20percent%20baseline%20tariff"
    },
    {
      "note": "Quote inside paragraph 2, falling back to paragraph 2",
      "url": "https://thai.news/news/economy/thailand-18-percent-us-tariff-deal-2027-economic-pivot-expats#p-2&q=18%20percent%20baseline%20tariff"
    },
    {
      "note": "W3C text fragment; #q= is the durable form",
      "url": "https://thai.news/news/economy/thailand-18-percent-us-tariff-deal-2027-economic-pivot-expats#:~:text=18%20percent%20baseline%20tariff"
    }
  ],
  "grammar": "#p-{n} | #q={encodeURIComponent(snippet)} | #p-{n}&q={encodeURIComponent(snippet)} | #:~:text={encoded snippet}",
  "hash": {
    "combine": "If both a paragraph hash and a quote are present (#p-2&q=... or #p-2:~:text=...), highlight the quote inside that paragraph when found, otherwise highlight the paragraph.",
    "paragraph": {
      "digits": "1-based paragraph number",
      "highlights": "paragraph n in yellow",
      "pattern": "#p-{n}"
    },
    "quote": {
      "also": "#:~:text={encoded snippet}",
      "pattern": "#q={encodeURIComponent(snippet)}",
      "prefer": "#q= as the durable form. Browsers strip #:~:text= from location.hash.",
      "snippet": "A short unique prefix, about 20-80 characters. First exact match in the rendered article. If the snippet is missing, nothing else is highlighted."
    }
  },
  "html": "https://thai.news/citation",
  "id": "thai.news-article-citation",
  "json": "https://thai.news/api/v1/articles/{category}/{slug}.json",
  "markdown": "https://thai.news/api/v1/articles/{category}/{slug}.md",
  "prompt": "Article citation hashes for THAI.NEWS. The URL is the API. No extra request.\nArticles: https://thai.news/news/{category}/{slug}\nMarkdown: https://thai.news/api/v1/articles/{category}/{slug}.md\nHash grammar:\n#p-{n} highlights paragraph n in yellow.\n#q={encodeURIComponent(snippet)} highlights the first exact match of that snippet (about 20-80 characters is enough). If the snippet is missing, do not highlight anything else.\n#p-{n}&q={encodeURIComponent(snippet)} highlights the quote inside paragraph n if found, otherwise highlights paragraph n.\n#:~:text={encoded snippet} is also accepted. Prefer #q= as the durable form (browsers strip #:~:text= from location.hash).\nExamples: https://thai.news/news/economy/thailand-18-percent-us-tariff-deal-2027-economic-pivot-expats#p-2 ; https://thai.news/news/economy/thailand-18-percent-us-tariff-deal-2027-economic-pivot-expats#q=18%20percent%20baseline%20tariff ; https://thai.news/news/economy/thailand-18-percent-us-tariff-deal-2027-economic-pivot-expats#p-2&q=18%20percent%20baseline%20tariff\nThis spec: https://thai.news/citation.json",
  "scope": "How to link any THAI.NEWS article and highlight a paragraph or quoted snippet directly via the URL hash.",
  "spec": "https://thai.news/citation.json",
  "title": "Article citation and highlight hashes"
}