From 55e5ad2d8f455ee7eb32896708701c3246f60bed Mon Sep 17 00:00:00 2001 From: Leonard Rosenthol Date: Fri, 11 Sep 2020 01:58:53 -0400 Subject: Changed default link state to invisible (#6676) --- src/Text/Pandoc/Writers/ICML.hs | 2 +- test/command/5541-localLink.md | 4 +- test/command/5541-urlLink.md | 2 +- test/command/6675.md | 134 ++++++++++++++++++++++++++++++++++++++++ test/writer.icml | 58 ++++++++--------- 5 files changed, 167 insertions(+), 33 deletions(-) create mode 100644 test/command/6675.md diff --git a/src/Text/Pandoc/Writers/ICML.hs b/src/Text/Pandoc/Writers/ICML.hs index dbfbfff5b..dcf5acfef 100644 --- a/src/Text/Pandoc/Writers/ICML.hs +++ b/src/Text/Pandoc/Writers/ICML.hs @@ -291,7 +291,7 @@ hyperlinksToDoc (x:xs) = hyp x $$ hyperlinksToDoc xs else selfClosingTag "HyperlinkURLDestination" [("Self", "HyperlinkURLDestination/"<>escapeColons url), ("Name","link"), ("DestinationURL",url), ("DestinationUniqueKey","1")] -- HyperlinkURLDestination with more than one colon crashes CS6 hlink = inTags True "Hyperlink" [("Self","uf-"<>tshow ident), ("Name",url), - ("Source","htss-"<>tshow ident), ("Visible","true"), ("DestinationUniqueKey","1")] + ("Source","htss-"<>tshow ident), ("Visible","false"), ("DestinationUniqueKey","1")] $ inTags True "Properties" [] $ inTags False "BorderColor" [("type","enumeration")] (text "Black") $$ inTags False "Destination" [("type","object")] (makeDest url) diff --git a/test/command/5541-localLink.md b/test/command/5541-localLink.md index 924607b3b..16430be34 100644 --- a/test/command/5541-localLink.md +++ b/test/command/5541-localLink.md @@ -133,13 +133,13 @@ if you can read this text, [and it's linked]{#spanner} - all good! - + Black HyperlinkTextDestination/#spanner - + Black HyperlinkTextDestination/#header-1 diff --git a/test/command/5541-urlLink.md b/test/command/5541-urlLink.md index 3c10490df..2ba81ce29 100644 --- a/test/command/5541-urlLink.md +++ b/test/command/5541-urlLink.md @@ -102,7 +102,7 @@ some more text that [links to](https://www.pandoc.org) Pandoc. - + Black HyperlinkURLDestination/https%3a//www.pandoc.org diff --git a/test/command/6675.md b/test/command/6675.md new file mode 100644 index 000000000..eac4214d7 --- /dev/null +++ b/test/command/6675.md @@ -0,0 +1,134 @@ +``` +% 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. + +and some text that [links to](#header-1) the first header + +^D + + + + + + + + + $ID/NormalCharacterStyle + + + + + + + + + LeftAlign + . + + 10 + + + + + + + $ID/NormalParagraphStyle + + + + + $ID/NormalParagraphStyle + + + + + $ID/NormalParagraphStyle + + + + + + + + + + + + + + + + + Header 1 + + +
+ + + this is some text + + +
+ + + + Header 2 + + +
+ + + some more text that + + + + Pandoc. + + +
+ + + and some text that + + + + the first header + + + +
+ + + Black + HyperlinkTextDestination/#header-1 + + + + + + Black + HyperlinkURLDestination/https%3a//www.pandoc.org + + +
+``` \ No newline at end of file diff --git a/test/writer.icml b/test/writer.icml index fa3e78fbf..a4b40056a 100644 --- a/test/writer.icml +++ b/test/writer.icml @@ -2999,203 +2999,203 @@ These should not be escaped: \$ \\ \> \[ \{ - + Black HyperlinkURLDestination/http%3a//google.com - + Black HyperlinkURLDestination/http%3a//example.com/ - + Black HyperlinkURLDestination/mailto%3anobody@nowhere.net - + Black HyperlinkURLDestination/http%3a//example.com/ - + Black HyperlinkURLDestination/http%3a//example.com/?foo=1&bar=2 - + Black HyperlinkURLDestination//script?foo=1&bar=2 - + Black HyperlinkURLDestination//script?foo=1&bar=2 - + Black HyperlinkURLDestination/http%3a//att.com/ - + Black HyperlinkURLDestination/http%3a//example.com/?foo=1&bar=2 - + Black HyperlinkURLDestination//url/ - + Black HyperlinkURLDestination//url/ - + Black HyperlinkURLDestination//url - + Black HyperlinkURLDestination//url - + Black HyperlinkURLDestination//url - + Black HyperlinkURLDestination//url/ - + Black HyperlinkURLDestination//url/ - + Black HyperlinkURLDestination//url/ - + Black HyperlinkURLDestination/ - + Black HyperlinkURLDestination/mailto%3anobody@nowhere.net - + Black HyperlinkURLDestination//url/with_underscore - + Black HyperlinkURLDestination//url/ - + Black HyperlinkURLDestination//url/ - + Black HyperlinkURLDestination//url/ - + Black HyperlinkURLDestination//url/ - + Black HyperlinkURLDestination//url/ - + Black HyperlinkURLDestination//url/ - + Black HyperlinkURLDestination/http%3a//example.com/?foo=1&bar=2 - + Black HyperlinkURLDestination//url - + Black HyperlinkURLDestination//url -- cgit v1.2.3