]> gitweb.factorcode.org Git - factor.git/commitdiff
help: don't consider children of $markup-examples for cross-referencing
authorSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Fri, 23 Oct 2009 08:27:45 +0000 (03:27 -0500)
committerSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Fri, 23 Oct 2009 08:27:45 +0000 (03:27 -0500)
basis/help/crossref/crossref-tests.factor
basis/help/markup/markup.factor
basis/help/vocabs/vocabs-tests.factor

index 4022d3bd382a2ac8ccb5fcea0d24cf8f4d50e170..6fb4c562cfd9038fe9e8b4c0451ee2557c1b078b 100644 (file)
@@ -1,6 +1,7 @@
 USING: help.crossref help.topics help.markup tools.test words
 definitions assocs sequences kernel namespaces parser arrays
-io.streams.string continuations debugger compiler.units eval ;
+io.streams.string continuations debugger compiler.units eval
+help.syntax ;
 IN: help.crossref.tests
 
 [ ] [
@@ -54,3 +55,11 @@ IN: help.crossref.tests
 ] unit-test
 
 [ "xxx" ] [ "yyy" article-parent ] unit-test
+
+ARTICLE: "crossref-test-1" "Crossref test 1"
+"Hello world" ;
+
+ARTICLE: "crossref-test-2" "Crossref test 2"
+{ $markup-example { $subsection "crossref-test-1" } } ;
+
+[ V{ } ] [ "crossref-test-2" >link article-children ] unit-test
index ea64df3edcf3b724c6e93a24b32a707530823c8f..229a025442c0f29d36ae7a7366ee5eb85eb379f0 100644 (file)
@@ -430,8 +430,8 @@ M: simple-element elements*
 M: object elements* 2drop ;
 
 M: array elements*
-    [ [ elements* ] with each ] 2keep
-    [ first eq? ] keep swap [ , ] [ drop ] if ;
+    [ dup first \ $markup-example eq? [ 2drop ] [ [ elements* ] with each ] if ]
+    [ [ first eq? ] keep swap [ , ] [ drop ] if ] 2bi ;
 
 : elements ( elt-type element -- seq ) [ elements* ] { } make ;
 
index 5637dd92f450d549426c25107c78a28d0c041355..aca1ae43c9d6e878a3b55f0d8585f38d00809722 100644 (file)
@@ -1,5 +1,6 @@
-USING: help.vocabs tools.test help.markup help vocabs ;
+USING: help.vocabs tools.test help.markup help vocabs io ;
 IN: help.vocabs.tests
 
 [ ] [ { $vocab "scratchpad" } print-content ] unit-test
 [ ] [ "classes" vocab print-topic ] unit-test
+[ ] [ nl ] unit-test