From ce9b26eb5034991273ea087f5f39e2b34aaa77a0 Mon Sep 17 00:00:00 2001 From: Luca Favatella Date: Thu, 9 Jun 2016 21:04:04 +0100 Subject: [PATCH 1/2] Mention support for linked svg and compressed svg as inline image ... since 76d8274. --- spec/html_examples/include-file.html | 12 ++++++++++++ spec/html_examples/inline-images.html | 6 ++++++ spec/html_examples/inline-images.org | 9 +++++++++ spec/markdown_examples/inline-images.md | 10 ++++++++++ spec/markdown_examples/inline-images.org | 9 +++++++++ 5 files changed, 46 insertions(+) diff --git a/spec/html_examples/include-file.html b/spec/html_examples/include-file.html index 6d9eace..47ed42b 100644 --- a/spec/html_examples/include-file.html +++ b/spec/html_examples/include-file.html @@ -85,7 +85,13 @@

Within a center block

  • .png
  • .gif
  • .jpeg
  • +
  • .svg
  • +
  • .svgz
  • +

    Sample .svg:

    +

    https://www.w3.org/Graphics/SVG/Test/20110816/svg/animate-dom-01-f.svg

    +

    Sample .svgz:

    +

    https://www.w3.org/Graphics/SVG/Test/20110816/svg/conform-viewers-01-t.svgz

    Within a blockquote

    This is similar to the center block:

    @@ -102,7 +108,13 @@

    Within a blockquote

  • .png
  • .gif
  • .jpeg
  • +
  • .svg
  • +
  • .svgz
  • +

    Sample .svg:

    +

    https://www.w3.org/Graphics/SVG/Test/20110816/svg/animate-dom-01-f.svg

    +

    Sample .svgz:

    +

    https://www.w3.org/Graphics/SVG/Test/20110816/svg/conform-viewers-01-t.svgz

    After

    Within an example block, it should not be possible to include a file.

    diff --git a/spec/html_examples/inline-images.html b/spec/html_examples/inline-images.html index 8f52176..c9d0f39 100644 --- a/spec/html_examples/inline-images.html +++ b/spec/html_examples/inline-images.html @@ -9,4 +9,10 @@
  • .png
  • .gif
  • .jpeg
  • +
  • .svg
  • +
  • .svgz
  • +

    Sample .svg:

    +

    https://www.w3.org/Graphics/SVG/Test/20110816/svg/animate-dom-01-f.svg

    +

    Sample .svgz:

    +

    https://www.w3.org/Graphics/SVG/Test/20110816/svg/conform-viewers-01-t.svgz

    diff --git a/spec/html_examples/inline-images.org b/spec/html_examples/inline-images.org index 9bb1608..3f85ac0 100644 --- a/spec/html_examples/inline-images.org +++ b/spec/html_examples/inline-images.org @@ -12,4 +12,13 @@ the inline image. I recognize the following image file types: - .png - .gif - .jpeg +- .svg +- .svgz +Sample .svg: + +[[https://www.w3.org/Graphics/SVG/Test/20110816/svg/animate-dom-01-f.svg]] + +Sample .svgz: + +[[https://www.w3.org/Graphics/SVG/Test/20110816/svg/conform-viewers-01-t.svgz]] diff --git a/spec/markdown_examples/inline-images.md b/spec/markdown_examples/inline-images.md index a54130e..fef912e 100644 --- a/spec/markdown_examples/inline-images.md +++ b/spec/markdown_examples/inline-images.md @@ -12,3 +12,13 @@ the inline image. I recognize the following image file types: * .png * .gif * .jpeg + * .svg + * .svgz + +Sample .svg: + +[https://www.w3.org/Graphics/SVG/Test/20110816/svg/animate-dom-01-f.svg](https://www.w3.org/Graphics/SVG/Test/20110816/svg/animate-dom-01-f.svg) + +Sample .svgz: + +[https://www.w3.org/Graphics/SVG/Test/20110816/svg/conform-viewers-01-t.svgz](https://www.w3.org/Graphics/SVG/Test/20110816/svg/conform-viewers-01-t.svgz) diff --git a/spec/markdown_examples/inline-images.org b/spec/markdown_examples/inline-images.org index 9bb1608..3f85ac0 100644 --- a/spec/markdown_examples/inline-images.org +++ b/spec/markdown_examples/inline-images.org @@ -12,4 +12,13 @@ the inline image. I recognize the following image file types: - .png - .gif - .jpeg +- .svg +- .svgz +Sample .svg: + +[[https://www.w3.org/Graphics/SVG/Test/20110816/svg/animate-dom-01-f.svg]] + +Sample .svgz: + +[[https://www.w3.org/Graphics/SVG/Test/20110816/svg/conform-viewers-01-t.svgz]] From fae10686d37b1e52e5d14ecf9dcefeae2a2654ea Mon Sep 17 00:00:00 2001 From: Luca Favatella Date: Thu, 9 Jun 2016 23:05:41 +0100 Subject: [PATCH 2/2] Make support for compressed svg for inlining image explicit Ref https://www.w3.org/TR/SVG11/conform.html#ConformingSVGViewers --- lib/org-ruby/regexp_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/org-ruby/regexp_helper.rb b/lib/org-ruby/regexp_helper.rb index ff94e0e..61b0087 100644 --- a/lib/org-ruby/regexp_helper.rb +++ b/lib/org-ruby/regexp_helper.rb @@ -185,7 +185,7 @@ def build_org_link_regexp ([^\]\[]+) # This is the friendly text \])?\]/x @org_angle_link_text_regexp = /<(\w+:[^\]\s<>]+)>/ - @org_image_file_regexp = /\.(gif|jpe?g|p(?:bm|gm|n[gm]|pm)|svg|tiff?|x[bp]m)/i + @org_image_file_regexp = /\.(gif|jpe?g|p(?:bm|gm|n[gm]|pm)|svgz?|tiff?|x[bp]m)/i end end # class Emphasis end # module Orgmode