Class CTEParsoidDocument

An object containing an HTMLIFrameElement along with helper functions to make manipulation easier.

Hierarchy

  • ParsoidDocument
    • CTEParsoidDocument

Constructors

Properties

A map of all Parsoid HTML elements and their attribution notices. When notices are detected, they are added here. ParsoidTemplateTransclusionNode is not used here since they are regenerated every time findTemplate is called.

originalCount: number = null

The original number of {{copied}} notices in the document.

addedRows: number = 1
defaultDocument: "<html><body><section data-mw-section-id=\"0\"></section></body></html>" = '<html><body><section data-mw-section-id="0"></section></body></html>'

Extremely minimalist valid Parsoid document. This includes a section 0 element for findCopiedNoticeSpot.

Methods

  • Look for a good spot to place a {{copied}} template.

    Parameters

    • type:
          | "copied"
          | "splitArticle"
          | "mergedFrom"
          | "mergedTo"
          | "backwardsCopy"
          | "translatedPage"

      The type of the notice to look a spot for.

    Returns [InsertPosition, HTMLElement]

    A spot to place the template, null if a spot could not be found.

  • Inserts a new attribution notice of a given type.

    Parameters

    • type:
          | "copied"
          | "splitArticle"
          | "mergedFrom"
          | "mergedTo"
          | "backwardsCopy"
          | "translatedPage"

      A notice type

    • spot: [InsertPosition, Element]

      The spot to place the template.

    Returns void