feat(extra-sheet) : add inline cell editing
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import {
|
||||
extraRichTextToPlainText,
|
||||
applyRichTextStylePatch,
|
||||
normalizeExtraRichText,
|
||||
richTextContentSignature,
|
||||
@@ -34,6 +35,14 @@ describe("rich text sanitization", () => {
|
||||
});
|
||||
|
||||
describe("legacy Extra rich text conversion", () => {
|
||||
it("converts stored markup into safe multiline text for cell editing", () => {
|
||||
expect(extraRichTextToPlainText(
|
||||
"<p><strong>First</strong><br>line</p><p>Second & safe<script>bad()</script></p>",
|
||||
)).toBe("First\nline\nSecond & safe");
|
||||
expect(normalizeExtraRichText(extraRichTextToPlainText("<p>A<br>B</p>")))
|
||||
.toBe("<p>A<br>B</p>");
|
||||
});
|
||||
|
||||
it("escapes plain text, preserves newlines, and converts phrase colors", () => {
|
||||
expect(normalizeExtraRichText("<unsafe>\nMASSIVE damage", [
|
||||
{ text: "MASSIVE", color: "#ff0000" },
|
||||
|
||||
Reference in New Issue
Block a user