Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTML -> ICML produced invalid result #9158

Closed
samatcolumn opened this issue Oct 24, 2023 · 3 comments
Closed

HTML -> ICML produced invalid result #9158

samatcolumn opened this issue Oct 24, 2023 · 3 comments
Labels

Comments

@samatcolumn
Copy link

Explain the problem.

I reproduced this on the https://pandoc.org/try/ site with html5 -> icml conversion and the "standalone" option checked.

The input and output are here (too big for the comment body);
https://gist.github.com/samatcolumn/d2edc51eb559c10a1d2c02328a1395d1

The error is specifically in this line of the output:

      <ParagraphStyle Self="ParagraphStyle/TablePar &gt; RightAlign &gt; LeftAlign" Name="TablePar &gt; RightAlign &gt; LeftAlign" LeftIndent="0" Justification="LeftAlign" Justification="RightAlign">

The Justification property is specified twice, which makes the ICML (XML, really) invalid.

Pandoc version?

All versions (and specifically, whatever version is online)

@jgm
Copy link
Owner

jgm commented Oct 25, 2023

Can you give a more minimal test case or at least identify the line number of that line?

@jgm jgm closed this as completed in 4457b77 Oct 25, 2023
@samatcolumn
Copy link
Author

Wow @jgm you fixed it before I even had a chance to provide a more minimal repro, thank you as always!

@samatcolumn
Copy link
Author

samatcolumn commented Oct 25, 2023

Fwiw, this is the most minimal repro I could come up with this morning:

html

<div custom-style="LeftAlign">
  <table>
    <tbody>
      <tr>
        <td><div custom-style="RightAlign">Hello</div></td>
      </tr>
    </tbody>
  </table>
</div>

icml

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<?aid style="50" type="snippet" readerVersion="6.0" featureSet="513" product="8.0(370)" ?>
<?aid SnippetType="InCopyInterchange"?>
<Document DOMVersion="8.0" Self="pandoc_doc">
    <RootCharacterStyleGroup Self="pandoc_character_styles">
      <CharacterStyle Self="$ID/NormalCharacterStyle" Name="Default" />
      
    </RootCharacterStyleGroup>
    <RootParagraphStyleGroup Self="pandoc_paragraph_styles">
      <ParagraphStyle Self="$ID/NormalParagraphStyle" Name="$ID/NormalParagraphStyle"
          SpaceBefore="6" SpaceAfter="6"> <!-- paragraph spacing -->
        <Properties>
          <TabList type="list">
            <ListItem type="record">
              <Alignment type="enumeration">LeftAlign</Alignment>
              <AlignmentCharacter type="string">.</AlignmentCharacter>
              <Leader type="string"></Leader>
              <Position type="unit">10</Position> <!-- first tab stop -->
            </ListItem>
          </TabList>
        </Properties>
      </ParagraphStyle>
      <ParagraphStyle Self="ParagraphStyle/LeftAlign &gt; TableCaption" Name="LeftAlign &gt; TableCaption" LeftIndent="0" Justification="LeftAlign">
        <Properties>
          <BasedOn type="object">$ID/NormalParagraphStyle</BasedOn>
        </Properties>
      </ParagraphStyle>
      <ParagraphStyle Self="ParagraphStyle/LeftAlign &gt; TablePar &gt; RightAlign" Name="LeftAlign &gt; TablePar &gt; RightAlign" LeftIndent="0" Justification="LeftAlign" Justification="RightAlign">
        <Properties>
          <BasedOn type="object">$ID/NormalParagraphStyle</BasedOn>
        </Properties>
      </ParagraphStyle>
    </RootParagraphStyleGroup>
    <RootTableStyleGroup Self="pandoc_table_styles">
      <TableStyle Self="TableStyle/Table" Name="Table" />
    </RootTableStyleGroup>
    <RootCellStyleGroup Self="pandoc_cell_styles">
      <CellStyle Self="CellStyle/Cell" AppliedParagraphStyle="ParagraphStyle/$ID/[No paragraph style]" Name="Cell" />
    </RootCellStyleGroup>
  <Story Self="pandoc_story"
      TrackChanges="false"
      StoryTitle=""
      AppliedTOCStyle="n"
      AppliedNamedGrid="n" >
    <StoryPreference OpticalMarginAlignment="true" OpticalMarginSize="12" />

<!-- body needs to be non-indented, otherwise code blocks are indented too far -->
<Table AppliedTableStyle="TableStyle/Table" HeaderRowCount="0" BodyRowCount="1" ColumnCount="1">
  <Column Name="0" SingleColumnWidth="500.0" />
  <Cell Name="0:0" AppliedCellStyle="CellStyle/Cell">
    <ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/LeftAlign &gt; TablePar &gt; RightAlign">
      <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
        <Content>Hello</Content>
      </CharacterStyleRange>
    </ParagraphStyleRange>
  </Cell>
</Table>
<ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/LeftAlign &gt; TableCaption">
</ParagraphStyleRange>

  </Story>
  
</Document>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants