mirror of
https://github.com/vale981/emacs-ipython-notebook
synced 2025-03-06 01:21:38 -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 ()
|
||||
(ein:testing-insert-html--fix-urls-do-test ,@args)))))
|
||||
|
||||
(ein:testing-insert-html--fix-urls-deftests
|
||||
(;; Simple replaces
|
||||
("<a href=files/spam>text</a>"
|
||||
"<a href=http://127.0.0.1:8888/files/spam>text</a>")
|
||||
("<a href=/files/spam>text</a>"
|
||||
"<a href=http://127.0.0.1:8888/files/spam>text</a>")
|
||||
("<img src=files/sample.png />"
|
||||
"<img src=http://127.0.0.1:8888/files/sample.png />")
|
||||
("<img src=/files/sample.png />"
|
||||
"<img src=http://127.0.0.1:8888/files/sample.png />")
|
||||
;; Do not modify dom in these cases:
|
||||
("<a>text</a>"
|
||||
"<a>text</a>")
|
||||
("<a href=http://example>text</a>"
|
||||
"<a href=http://example>text</a>")
|
||||
("<img src=http://example />"
|
||||
"<img src=http://example />")
|
||||
;; Bit more complicated cases:
|
||||
("<p><a href=files/spam>link</a> normal</p>"
|
||||
"<p><a href=http://127.0.0.1:8888/files/spam>link</a> normal</p>")
|
||||
("<img><img src=files/sample.png /> normal</p>"
|
||||
"<img><img src=http://127.0.0.1:8888/files/sample.png /> normal</p>")
|
||||
))
|
||||
(when (require 'shr nil t)
|
||||
(ein:testing-insert-html--fix-urls-deftests
|
||||
(;; Simple replaces
|
||||
("<a href=files/spam>text</a>"
|
||||
"<a href=http://127.0.0.1:8888/files/spam>text</a>")
|
||||
("<a href=/files/spam>text</a>"
|
||||
"<a href=http://127.0.0.1:8888/files/spam>text</a>")
|
||||
("<img src=files/sample.png />"
|
||||
"<img src=http://127.0.0.1:8888/files/sample.png />")
|
||||
("<img src=/files/sample.png />"
|
||||
"<img src=http://127.0.0.1:8888/files/sample.png />")
|
||||
;; Do not modify dom in these cases:
|
||||
("<a>text</a>"
|
||||
"<a>text</a>")
|
||||
("<a href=http://example>text</a>"
|
||||
"<a href=http://example>text</a>")
|
||||
("<img src=http://example />"
|
||||
"<img src=http://example />")
|
||||
;; Bit more complicated cases:
|
||||
("<p><a href=files/spam>link</a> normal</p>"
|
||||
"<p><a href=http://127.0.0.1:8888/files/spam>link</a> 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