(parent *xhtml.Node, rep *Report, nctx *nativeCtx)
| 523 | } |
| 524 | |
| 525 | func applyFeishuNativeStyles(parent *xhtml.Node, rep *Report, nctx *nativeCtx) { |
| 526 | child := parent.FirstChild |
| 527 | for child != nil { |
| 528 | next := child.NextSibling |
| 529 | if child.Type == xhtml.ElementNode { |
| 530 | switch strings.ToLower(child.Data) { |
| 531 | case "ol", "ul": |
| 532 | wrapNonLIListChildren(child, rep) |
| 533 | ensureFeishuListStyle(child, rep) |
| 534 | case "li": |
| 535 | ensureFeishuListItemStyle(child, parent, rep, nctx) |
| 536 | case "blockquote": |
| 537 | ensureFeishuBlockquoteStyle(child, rep) |
| 538 | case "a": |
| 539 | ensureFeishuLinkStyle(child, rep) |
| 540 | case "p": |
| 541 | rewritePToFeishuDiv(child, rep) |
| 542 | } |
| 543 | } |
| 544 | // child may have been mutated (children moved into a wrapper); |
| 545 | // recurse only if it's still attached. |
| 546 | if child.Parent != nil { |
| 547 | applyFeishuNativeStyles(child, rep, nctx) |
| 548 | } |
| 549 | child = next |
| 550 | } |
| 551 | } |
| 552 | |
| 553 | // wrapNonLIListChildren scans the direct children of an <ol>/<ul> and wraps |
| 554 | // any element that is not <li> in a fresh <li>. HTML spec is explicit that |
no test coverage detected