commit e73164e25dd04fd3c655ab9988f4f8e098e39937
Author: Uwe Stöhr <[email protected]>
Date:   Sun Dec 17 02:28:54 2017 +0100

    tex2lyx: support to detect https:// links
    
    - Preamble.cpp: use the occasion to backport JMarcs recent compiler warning 
fixe
---
 src/tex2lyx/Preamble.cpp |    7 +++----
 src/tex2lyx/text.cpp     |    4 ++--
 2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/src/tex2lyx/Preamble.cpp b/src/tex2lyx/Preamble.cpp
index ea315dd..fe722f4 100644
--- a/src/tex2lyx/Preamble.cpp
+++ b/src/tex2lyx/Preamble.cpp
@@ -689,7 +689,6 @@ void Preamble::handle_package(Parser &p, string const & 
name,
 {
        vector<string> options = split_options(opts);
        add_package(name, options);
-       char const * const * where = 0;
 
        if (is_known(name, known_xetex_packages)) {
                xetex = true;
@@ -1016,7 +1015,7 @@ void Preamble::handle_package(Parser &p, string const & 
name,
        else if (name == "subfig")
                ; // ignore this FIXME: Use the package separator mechanism 
instead
 
-       else if ((where = is_known(name, known_languages)))
+       else if (char const * const * where = is_known(name, known_languages))
                h_language = known_coded_languages[where - known_languages];
 
        else if (name == "natbib") {
@@ -1114,9 +1113,9 @@ bool Preamble::writeLyXHeader(ostream & os, bool subdoc, 
string const & outfiled
        // LyX only knows the following quotes languages:
        // english, swedish, german, polish, french and danish
        // (quotes for "japanese" and "chinese-traditional" are missing because
-       //  they wouldn't be useful: http://www.lyx.org/trac/ticket/6383)
+       //  they wouldn't be useful: https://www.lyx.org/trac/ticket/6383)
        // conversion list taken from
-       // http://en.wikipedia.org/wiki/Quotation_mark,_non-English_usage
+       // https://en.wikipedia.org/wiki/Quotation_mark,_non-English_usage
        // (quotes for kazakh and interlingua are unknown)
        // danish
        if (is_known(h_language, known_danish_quotes_languages))
diff --git a/src/tex2lyx/text.cpp b/src/tex2lyx/text.cpp
index 2fe40bd..5330c62 100644
--- a/src/tex2lyx/text.cpp
+++ b/src/tex2lyx/text.cpp
@@ -3621,8 +3621,8 @@ void parse_text(Parser & p, ostream & os, unsigned flags, 
bool outer,
                                type = target.substr(0, i + 1);
                                if (type == "mailto:"; || type == "file:")
                                        target = target.substr(i + 1);
-                               // handle the case that name is equal to 
target, except of "http://";
-                               else if (target.substr(i + 3) == name && type 
== "http:")
+                               // handle the case that name is equal to 
target, except of "http(s)://"
+                               else if (target.substr(i + 3) == name && (type 
== "http:" || type == "https:"))
                                        target = name;
                        }
                        begin_command_inset(os, "href", "href");

Reply via email to