mirror of
https://github.com/vale981/emacs-ipython-notebook
synced 2025-03-06 09:31:39 -05:00
Do not test ein:insert-html when SHR is not available
This commit is contained in:
parent
2344691f67
commit
1e5a3ad489
1 changed files with 24 additions and 23 deletions
|
@ -18,26 +18,27 @@
|
||||||
`(ert-deftest ,test ()
|
`(ert-deftest ,test ()
|
||||||
(ein:testing-insert-html--fix-urls-do-test ,@args)))))
|
(ein:testing-insert-html--fix-urls-do-test ,@args)))))
|
||||||
|
|
||||||
(ein:testing-insert-html--fix-urls-deftests
|
(when (require 'shr nil t)
|
||||||
(;; Simple replaces
|
(ein:testing-insert-html--fix-urls-deftests
|
||||||
("<a href=files/spam>text</a>"
|
(;; Simple replaces
|
||||||
"<a href=http://127.0.0.1:8888/files/spam>text</a>")
|
("<a href=files/spam>text</a>"
|
||||||
("<a href=/files/spam>text</a>"
|
"<a href=http://127.0.0.1:8888/files/spam>text</a>")
|
||||||
"<a href=http://127.0.0.1:8888/files/spam>text</a>")
|
("<a href=/files/spam>text</a>"
|
||||||
("<img src=files/sample.png />"
|
"<a href=http://127.0.0.1:8888/files/spam>text</a>")
|
||||||
"<img src=http://127.0.0.1:8888/files/sample.png />")
|
("<img src=files/sample.png />"
|
||||||
("<img src=/files/sample.png />"
|
"<img src=http://127.0.0.1:8888/files/sample.png />")
|
||||||
"<img src=http://127.0.0.1:8888/files/sample.png />")
|
("<img src=/files/sample.png />"
|
||||||
;; Do not modify dom in these cases:
|
"<img src=http://127.0.0.1:8888/files/sample.png />")
|
||||||
("<a>text</a>"
|
;; Do not modify dom in these cases:
|
||||||
"<a>text</a>")
|
("<a>text</a>"
|
||||||
("<a href=http://example>text</a>"
|
"<a>text</a>")
|
||||||
"<a href=http://example>text</a>")
|
("<a href=http://example>text</a>"
|
||||||
("<img src=http://example />"
|
"<a href=http://example>text</a>")
|
||||||
"<img src=http://example />")
|
("<img src=http://example />"
|
||||||
;; Bit more complicated cases:
|
"<img src=http://example />")
|
||||||
("<p><a href=files/spam>link</a> normal</p>"
|
;; Bit more complicated cases:
|
||||||
"<p><a href=http://127.0.0.1:8888/files/spam>link</a> normal</p>")
|
("<p><a href=files/spam>link</a> normal</p>"
|
||||||
("<img><img src=files/sample.png /> normal</p>"
|
"<p><a href=http://127.0.0.1:8888/files/spam>link</a> normal</p>")
|
||||||
"<img><img src=http://127.0.0.1:8888/files/sample.png /> normal</p>")
|
("<img><img src=files/sample.png /> normal</p>"
|
||||||
))
|
"<img><img src=http://127.0.0.1:8888/files/sample.png /> normal</p>")
|
||||||
|
)))
|
||||||
|
|
Loading…
Add table
Reference in a new issue