]> gitweb.factorcode.org Git - factor.git/commitdiff
html.streams: move icon src mapping to help.html.
authorJohn Benediktsson <mrjbq7@gmail.com>
Fri, 22 May 2020 00:19:36 +0000 (17:19 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Fri, 22 May 2020 00:19:36 +0000 (17:19 -0700)
basis/help/html/html.factor
basis/html/streams/streams-tests.factor
basis/html/streams/streams.factor

index 52afaae95a2a62ab0f7d5438a5999d547ce9d7f9..107d0b62a8a50b53dddbcc097e79ef5a4b217090 100644 (file)
@@ -149,10 +149,17 @@ M: pathname url-of
             seq>> [
                 T{ name { main "img" } } over tag-named? [
                     dup "src" attr
-                    dup "@2x.png" tail? [ 2drop ] [
+
+                    ! use @2x retina images
+                    dup "@2x.png" tail? [
                         "." split1-last "@2x." glue
-                        "src" set-attr
-                    ] if
+                    ] unless
+
+                    ! src mapping for webapps.help
+                    "vocab:definitions/icons/" ?head
+                    [ "/icons/" prepend ] when
+
+                    "src" set-attr
                 ] [ drop ] if
             ] deep-each
         ] [ drop ] if
index 4be6a663c261777f006d96035e1809e11ed0433b..a0cd6c47a6b20fe4ec53cb9a7e869cb1779caca0 100644 (file)
@@ -62,11 +62,3 @@ M: funky url-of "http://www.funky-town.com/" swap town>> append ;
 ] unit-test
 
 { } [ [ { 1 2 3 } describe ] with-html-writer drop ] unit-test
-
-{ "<img src=\"/icons/class-word.tiff\"/>" } [
-    [
-        "text"
-        { { image-style "vocab:definitions/icons/class-word.tiff" } }
-        format
-    ] make-html-string
-] unit-test
index 7a20014388a2fbbc1735d063ab98ebe461ac75ce..3590db7e56125d790364f499892b5b35a48e94e7 100644 (file)
@@ -77,11 +77,8 @@ MACRO: make-css ( pairs -- str )
 : emit-html ( stream quot -- )
     dip data>> push ; inline
 
-: icon-path ( path -- icons-path )
-    "vocab:definitions/icons/" ?head [ "/icons/" prepend ] when ;
-
 : img-tag ( xml style -- xml )
-    image-style of [ nip icon-path simple-image ] when* ;
+    image-style of [ nip simple-image ] when* ;
 
 : format-html-span ( string style stream -- )
     [