[libgepub] Do not rewrite page-relative anchor links



commit 6f1f18f6afb1e1e4d421ebb8f6c2c223bf9ae217
Author: IBBoard <dev ibboard co uk>
Date:   Sun Apr 21 20:55:29 2019 +0100

    Do not rewrite page-relative anchor links
    
    If we rewrite them then we get "epub:///path/#anchor" URLs, which
    are no-longer page-relative

 libgepub/gepub-utils.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/libgepub/gepub-utils.c b/libgepub/gepub-utils.c
index eda1524..2f5d1c2 100644
--- a/libgepub/gepub-utils.c
+++ b/libgepub/gepub-utils.c
@@ -58,7 +58,7 @@ set_epub_uri (xmlNode *node,
         if (cur_node->type == XML_ELEMENT_NODE ) {
             text = xmlGetProp (cur_node, BAD_CAST (attr));
 
-            if (!strcmp ((const char *) cur_node->name, tagname) && text) {
+            if (!strcmp ((const char *) cur_node->name, tagname) && text && text[0] != '#') {
                 SoupURI *uri = soup_uri_new_with_base (baseURI, (const char *) text);
                 gchar *value = soup_uri_to_string (uri, FALSE);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]