News for hackers. Stuff that matters.
Re:Show HN: Single-header C++11 HTML document constructor by tlb on Sunday December 16, 2018 @05:32PM (#18695667)
It's worth getting the escaping right in a library like this. For example, at https://github.com/tinfoilboy/CTML/blob/master/include/ctml....

  for (const auto& attr : m_attributes)
    output << " " << attr.first + "=\"" << attr.second + "\"";
it'll generate incorrect HTML if an attribute value has a " character. Although early versions of HTML were kind of vague on how escaping was supposed to work, the HTML5 standard explains it in detail.
Re:Show HN: Single-header C++11 HTML document constructor by tinfoilboy on Sunday December 16, 2018 @06:14PM (#18695843)
I'll add escaping attributes to the library according to the spec. Thank you for the heads up!
Re:Show HN: Single-header C++11 HTML document constructor by im3w1l on Monday December 17, 2018 @01:54AM (#18697349)
Please look it over once, twice and thrice. Getting escaping correct is the main reason to use a library like this over manual construction with a heap of string concatenations.
Re:Show HN: Single-header C++11 HTML document constructor by sail0rm00n on Monday December 17, 2018 @01:24AM (#18697254)