Repository: lucy-clownfish
Updated Branches:
  refs/heads/master 1e2579403 -> 8875d01ed


Support cfish:@null URIs in HTML docs


Project: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/commit/8210ce8e
Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/8210ce8e
Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/8210ce8e

Branch: refs/heads/master
Commit: 8210ce8e6595be3ee0f30fb54240800642e41caa
Parents: 1e25794
Author: Nick Wellnhofer <wellnho...@aevum.de>
Authored: Thu Aug 20 23:19:46 2015 +0200
Committer: Nick Wellnhofer <wellnho...@aevum.de>
Committed: Thu Aug 20 23:19:46 2015 +0200

----------------------------------------------------------------------
 compiler/src/CFCCHtml.c           | 9 +++++----
 compiler/src/CFCTestDocuComment.c | 8 ++++----
 2 files changed, 9 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/8210ce8e/compiler/src/CFCCHtml.c
----------------------------------------------------------------------
diff --git a/compiler/src/CFCCHtml.c b/compiler/src/CFCCHtml.c
index 24576fe..898a06d 100644
--- a/compiler/src/CFCCHtml.c
+++ b/compiler/src/CFCCHtml.c
@@ -1018,11 +1018,12 @@ S_transform_link(cmark_node *link, CFCClass *doc_class, 
int dir_level) {
         return;
     }
 
-    CFCUri *uri_obj = CFCUri_new(uri_string, doc_class);
-    char   *url     = S_cfc_uri_to_url(uri_obj, doc_class, dir_level);
+    CFCUri     *uri_obj  = CFCUri_new(uri_string, doc_class);
+    CFCUriType  uri_type = CFCUri_get_type(uri_obj);
+    char       *url      = S_cfc_uri_to_url(uri_obj, doc_class, dir_level);
 
-    if (CFCUri_get_type(uri_obj) == CFC_URI_ERROR) {
-        // Replace link with error.
+    if (uri_type == CFC_URI_NULL || uri_type == CFC_URI_ERROR) {
+        // Replace link with text.
         char *link_text = CFCC_link_text(uri_obj);
         cmark_node *text_node = cmark_node_new(CMARK_NODE_TEXT);
         cmark_node_set_literal(text_node, link_text);

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/8210ce8e/compiler/src/CFCTestDocuComment.c
----------------------------------------------------------------------
diff --git a/compiler/src/CFCTestDocuComment.c 
b/compiler/src/CFCTestDocuComment.c
index 391d528..dc89f94 100644
--- a/compiler/src/CFCTestDocuComment.c
+++ b/compiler/src/CFCTestDocuComment.c
@@ -130,7 +130,7 @@ S_test_generator(CFCTest *test) {
         " * \n"
         " * Paragraph: *emphasized*, **strong**, `code`.\n"
         " * \n"
-        " * Paragraph: [link](http://example.com/).\n"
+        " * Paragraph: [link](http://example.com/), [](cfish:@null).\n"
         " * \n"
         " *     Code 1\n"
         " *     Code 2\n"
@@ -162,7 +162,7 @@ S_test_generator(CFCTest *test) {
         ".UR http://example.com/\n";
         "link\n"
         ".UE\n"
-        "\\&.\n"
+        ", NULL\\&.\n"
         ".IP\n"
         ".nf\n"
         ".fam C\n"
@@ -217,7 +217,7 @@ S_test_generator(CFCTest *test) {
         "<h2>Description</h2>\n"
         "<h1>Heading 1</h1>\n"
         "<p>Paragraph: <em>emphasized</em>, <strong>strong</strong>, 
<code>code</code>.</p>\n"
-        "<p>Paragraph: <a href=\"http://example.com/\";>link</a>.</p>\n"
+        "<p>Paragraph: <a href=\"http://example.com/\";>link</a>, NULL.</p>\n"
         "<pre><code>Code 1\n"
         "Code 2\n"
         "</code></pre>\n"
@@ -254,7 +254,7 @@ S_test_generator(CFCTest *test) {
         "\n"
         "Paragraph: I<emphasized>, B<strong>, C<code>.\n"
         "\n"
-        "Paragraph: L<link|http://example.com/>.\n"
+        "Paragraph: L<link|http://example.com/>, undef.\n"
         "\n"
         "    Code 1\n"
         "    Code 2\n"

Reply via email to