diff options
author | Leonard Rosenthol <leonardr@lazerware.com> | 2020-09-10 12:40:35 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-10 09:40:35 -0700 |
commit | ef4f5143593d24f426c830006b77b7c0e837b9de (patch) | |
tree | c0e8d452e6f25d74ef252f0a8ca5c525afd7d018 /test/command | |
parent | 96a0f3c7affe550c5ef5330df3d17197244f92d7 (diff) | |
download | pandoc-ef4f5143593d24f426c830006b77b7c0e837b9de.tar.gz |
Implement support for internal document links in ICML (#6606)
Closes #5541.
Diffstat (limited to 'test/command')
-rw-r--r-- | test/command/5541-localLink.md | 149 | ||||
-rw-r--r-- | test/command/5541-nesting.md | 97 | ||||
-rw-r--r-- | test/command/5541-urlLink.md | 112 |
3 files changed, 358 insertions, 0 deletions
diff --git a/test/command/5541-localLink.md b/test/command/5541-localLink.md new file mode 100644 index 000000000..924607b3b --- /dev/null +++ b/test/command/5541-localLink.md @@ -0,0 +1,149 @@ +``` +% pandoc -f markdown -t icml -s + +# Header 1 + +this is some text + +## Header 2 + +some more text that [links to](#header-1) the first header. And this links to [some text](#spanner) in 2.1. + +## Header 2.1 + +if you can read this text, [and it's linked]{#spanner} - all good! + +^D +<?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" /> + <CharacterStyle Self="CharacterStyle/Link" Name="Link"> + <Properties> + <BasedOn type="object">$ID/NormalCharacterStyle</BasedOn> + </Properties> + </CharacterStyle> + </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/Header1" Name="Header1" LeftIndent="0" PointSize="36"> + <Properties> + <BasedOn type="object">$ID/NormalParagraphStyle</BasedOn> + </Properties> + </ParagraphStyle> + <ParagraphStyle Self="ParagraphStyle/Header2" Name="Header2" LeftIndent="0" PointSize="30"> + <Properties> + <BasedOn type="object">$ID/NormalParagraphStyle</BasedOn> + </Properties> + </ParagraphStyle> + <ParagraphStyle Self="ParagraphStyle/Paragraph" Name="Paragraph" LeftIndent="0"> + <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 --> +<ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Header1"> + <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle"> + <HyperlinkTextDestination Self="HyperlinkTextDestination/#header-1" Name="Destination" DestinationUniqueKey="1" /> + <Content>Header 1</Content> + </CharacterStyleRange> +</ParagraphStyleRange> +<Br /> +<ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Paragraph"> + <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle"> + <Content>this is some text</Content> + </CharacterStyleRange> +</ParagraphStyleRange> +<Br /> +<ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Header2"> + <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle"> + <HyperlinkTextDestination Self="HyperlinkTextDestination/#header-2" Name="Destination" DestinationUniqueKey="1" /> + <Content>Header 2</Content> + </CharacterStyleRange> +</ParagraphStyleRange> +<Br /> +<ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Paragraph"> + <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle"> + <Content>some more text that </Content> + </CharacterStyleRange> + <HyperlinkTextSource Self="htss-1" Name="" Hidden="false"> + <CharacterStyleRange AppliedCharacterStyle="CharacterStyle/Link"> + <Content>links to</Content> + </CharacterStyleRange> + </HyperlinkTextSource> + <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle"> + <Content> the first header. And this links to </Content> + </CharacterStyleRange> + <HyperlinkTextSource Self="htss-2" Name="" Hidden="false"> + <CharacterStyleRange AppliedCharacterStyle="CharacterStyle/Link"> + <Content>some text</Content> + </CharacterStyleRange> + </HyperlinkTextSource> + <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle"> + <Content> in 2.1.</Content> + </CharacterStyleRange> +</ParagraphStyleRange> +<Br /> +<ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Header2"> + <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle"> + <HyperlinkTextDestination Self="HyperlinkTextDestination/#header-2.1" Name="Destination" DestinationUniqueKey="1" /> + <Content>Header 2.1</Content> + </CharacterStyleRange> +</ParagraphStyleRange> +<Br /> +<ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Paragraph"> + <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle"> + <Content>if you can read this text, </Content> + </CharacterStyleRange> + <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle"> + <HyperlinkTextDestination Self="HyperlinkTextDestination/#spanner" Name="Destination" DestinationUniqueKey="1" /> + <Content>and it’s linked</Content> + </CharacterStyleRange> + <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle"> + <Content> - all good!</Content> + </CharacterStyleRange> +</ParagraphStyleRange> + + </Story> + <Hyperlink Self="uf-2" Name="#spanner" Source="htss-2" Visible="true" DestinationUniqueKey="1"> + <Properties> + <BorderColor type="enumeration">Black</BorderColor> + <Destination type="object">HyperlinkTextDestination/#spanner</Destination> + </Properties> + </Hyperlink> + <Hyperlink Self="uf-1" Name="#header-1" Source="htss-1" Visible="true" DestinationUniqueKey="1"> + <Properties> + <BorderColor type="enumeration">Black</BorderColor> + <Destination type="object">HyperlinkTextDestination/#header-1</Destination> + </Properties> + </Hyperlink> +</Document> +```
\ No newline at end of file diff --git a/test/command/5541-nesting.md b/test/command/5541-nesting.md new file mode 100644 index 000000000..616184f5c --- /dev/null +++ b/test/command/5541-nesting.md @@ -0,0 +1,97 @@ +``` +% pandoc -f html -t icml -s + +<div id="blockId"> + <div id="blockId2"> + <span id="inlineId"> + <img id="inlineId2" src="lalune.jpg" /> + </span> + </div> +</div> + +^D +<?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" /> + <CharacterStyle Self="CharacterStyle/" Name=""> + <Properties> + <BasedOn type="object">$ID/NormalCharacterStyle</BasedOn> + </Properties> + </CharacterStyle> + </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/" Name="" LeftIndent="0"> + <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 --> +<ParagraphStyleRange AppliedParagraphStyle=""> + <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle"> + <HyperlinkTextDestination Self="HyperlinkTextDestination/#inlineId" Name="Destination" DestinationUniqueKey="1" /> + <Content> </Content> + </CharacterStyleRange> + <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle"> + <Rectangle Self="uec" StrokeWeight="0" ItemTransform="1 0 0 1 75 -75"> + <Properties> + <PathGeometry> + <GeometryPathType PathOpen="false"> + <PathPointArray> + <PathPointType Anchor="-75 -75" LeftDirection="-75 -75" RightDirection="-75 -75" /> + <PathPointType Anchor="-75 75" LeftDirection="-75 75" RightDirection="-75 75" /> + <PathPointType Anchor="75 75" LeftDirection="75 75" RightDirection="75 75" /> + <PathPointType Anchor="75 -75" LeftDirection="75 -75" RightDirection="75 -75" /> + </PathPointArray> + </GeometryPathType> + </PathGeometry> + </Properties> + <Image Self="ue6" ItemTransform="1 0 0 1 -75 -75"> + <Properties> + <Profile type="string"> + $ID/Embedded + </Profile> + </Properties> + <Link Self="ueb" LinkResourceURI="file:lalune.jpg" /> + </Image> + </Rectangle> + </CharacterStyleRange> + <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle"> + <HyperlinkTextDestination Self="HyperlinkTextDestination/#inlineId" Name="Destination" DestinationUniqueKey="1" /> + <Content> </Content> + </CharacterStyleRange> +</ParagraphStyleRange> + + </Story> + +</Document> +```
\ No newline at end of file diff --git a/test/command/5541-urlLink.md b/test/command/5541-urlLink.md new file mode 100644 index 000000000..3c10490df --- /dev/null +++ b/test/command/5541-urlLink.md @@ -0,0 +1,112 @@ +``` +% pandoc -f markdown -t icml -s + +# Header 1 + +this is some text + +## Header 2 + +some more text that [links to](https://www.pandoc.org) Pandoc. + +^D +<?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" /> + <CharacterStyle Self="CharacterStyle/Link" Name="Link"> + <Properties> + <BasedOn type="object">$ID/NormalCharacterStyle</BasedOn> + </Properties> + </CharacterStyle> + </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/Header1" Name="Header1" LeftIndent="0" PointSize="36"> + <Properties> + <BasedOn type="object">$ID/NormalParagraphStyle</BasedOn> + </Properties> + </ParagraphStyle> + <ParagraphStyle Self="ParagraphStyle/Header2" Name="Header2" LeftIndent="0" PointSize="30"> + <Properties> + <BasedOn type="object">$ID/NormalParagraphStyle</BasedOn> + </Properties> + </ParagraphStyle> + <ParagraphStyle Self="ParagraphStyle/Paragraph" Name="Paragraph" LeftIndent="0"> + <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 --> +<ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Header1"> + <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle"> + <HyperlinkTextDestination Self="HyperlinkTextDestination/#header-1" Name="Destination" DestinationUniqueKey="1" /> + <Content>Header 1</Content> + </CharacterStyleRange> +</ParagraphStyleRange> +<Br /> +<ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Paragraph"> + <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle"> + <Content>this is some text</Content> + </CharacterStyleRange> +</ParagraphStyleRange> +<Br /> +<ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Header2"> + <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle"> + <HyperlinkTextDestination Self="HyperlinkTextDestination/#header-2" Name="Destination" DestinationUniqueKey="1" /> + <Content>Header 2</Content> + </CharacterStyleRange> +</ParagraphStyleRange> +<Br /> +<ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Paragraph"> + <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle"> + <Content>some more text that </Content> + </CharacterStyleRange> + <HyperlinkTextSource Self="htss-1" Name="" Hidden="false"> + <CharacterStyleRange AppliedCharacterStyle="CharacterStyle/Link"> + <Content>links to</Content> + </CharacterStyleRange> + </HyperlinkTextSource> + <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle"> + <Content> Pandoc.</Content> + </CharacterStyleRange> +</ParagraphStyleRange> + + </Story> + <HyperlinkURLDestination Self="HyperlinkURLDestination/https%3a//www.pandoc.org" Name="link" DestinationURL="https://www.pandoc.org" DestinationUniqueKey="1" /> + <Hyperlink Self="uf-1" Name="https://www.pandoc.org" Source="htss-1" Visible="true" DestinationUniqueKey="1"> + <Properties> + <BorderColor type="enumeration">Black</BorderColor> + <Destination type="object">HyperlinkURLDestination/https%3a//www.pandoc.org</Destination> + </Properties> + </Hyperlink> +</Document> +```
\ No newline at end of file |