Merge branch 'NOOK-565'
This commit is contained in:
@@ -35,7 +35,11 @@ const ENTITY_REPLACEMENTS: [RegExp, string][] = [
|
|||||||
[/</g, "<"],
|
[/</g, "<"],
|
||||||
[/>/g, ">"],
|
[/>/g, ">"],
|
||||||
[/"/g, '"'],
|
[/"/g, '"'],
|
||||||
|
// Python's html.escape, which embed_release_notes.py writes the appcast
|
||||||
|
// with, prefers the hex form for apostrophes (NOOK-565).
|
||||||
|
[/'/g, "'"],
|
||||||
[/'/g, "'"],
|
[/'/g, "'"],
|
||||||
|
[/'/g, "'"],
|
||||||
[/ /g, " "],
|
[/ /g, " "],
|
||||||
// Last, so "&lt;" cannot decode twice.
|
// Last, so "&lt;" cannot decode twice.
|
||||||
[/&/g, "&"]
|
[/&/g, "&"]
|
||||||
|
|||||||
@@ -256,6 +256,21 @@ describe("sectionsFromHtml", () => {
|
|||||||
expect(sectionsFromHtml("")).toEqual([]);
|
expect(sectionsFromHtml("")).toEqual([]);
|
||||||
expect(sectionsFromHtml("<p><b>Added</b></p>")).toEqual([]);
|
expect(sectionsFromHtml("<p><b>Added</b></p>")).toEqual([]);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("decodes the entities embed_release_notes.py's html.escape writes", () => {
|
||||||
|
// Python's html.escape prefers the hex form for apostrophes; this is what
|
||||||
|
// the live appcast actually carries (NOOK-565).
|
||||||
|
expect(
|
||||||
|
sectionsFromHtml(
|
||||||
|
"<p><b>Added</b></p><ul><li>Each app's meter & the icon</li><li>don't expand</li></ul>"
|
||||||
|
)
|
||||||
|
).toEqual([
|
||||||
|
{
|
||||||
|
title: "Added",
|
||||||
|
bullets: ["Each app's meter & the icon", "don't expand"]
|
||||||
|
}
|
||||||
|
]);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("isoDateOrNull", () => {
|
describe("isoDateOrNull", () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user