TrialAndErrorOrg / parsers

Monorepo for a suite of `unified`-compatible converters for converting between, from, and to .docx, JATS XML, LaTeX, and PDF
https://convert.centeroftrialanderror.com
GNU General Public License v3.0
15 stars 0 forks source link

[jast-util-to-texast] Check whether col how multirow elements #45

Closed github-actions[bot] closed 3 months ago

github-actions[bot] commented 1 year ago

[jast-util-to-texast] Check whether col how multirow elements

error out while underfull ones are fine

https://github.com/TrialAndErrorOrg/parsers/blob/1cd9f7e9a1820388ad31153452c224e4c1c910de/libs/jast/jast-util-to-texast/src/lib/handlers/table.ts#L28


    (node: Col | Tr) => {
      if (node.name === 'col') {
        hasCols = true
        columns.push('l')

        // TODO: [jast-util-to-texast] Check whether col how multirow elements
        numberOfRows = node.children.length

        return
      }

      if (hasCols) return

      numberOfRows += 1

      let tempCols: string[] = []

      node?.children?.forEach((child) => {
        if (!isElement(child)) return

        if (child.name !== 'td') return

        for (let i = 0; i < (child?.attributes?.colspan ?? 1); i++) {
          tempCols.push('l')
        }
      })
      // Just make the table as wide as it needs to be, overfull tables
      // error out while  underfull ones are fine

b7572ce66285efd133d078766b47d03395ff98bb

github-actions[bot] commented 3 months ago

Closed in 63a6ca2cbd1729dd27de48746d5ff25c09016822

github-actions[bot] commented 3 months ago

Closed in a56d7d8a39b78ce5dcc0a53143cf5dd993440013