]> git.lyx.org Git - features.git/commitdiff
tex2lyx: support to detect https:// links
authorUwe Stöhr <uwestoehr@lyx.org>
Sun, 17 Dec 2017 01:28:54 +0000 (02:28 +0100)
committerUwe Stöhr <uwestoehr@lyx.org>
Sun, 17 Dec 2017 01:28:54 +0000 (02:28 +0100)
- Preamble.cpp: use the occasion to backport JMarcs recent compiler warning fixe

src/tex2lyx/Preamble.cpp
src/tex2lyx/text.cpp

index ea315dd156677da80c165acdce4cbe8e97c5fed9..fe722f48e27a6503590319c30a43697be2f2ef65 100644 (file)
@@ -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))
index 2fe40bde05cadfbab9aa39ac4417e75b3e812609..5330c624cf64fa5b3cb15553316f00cf2d91aab1 100644 (file)
@@ -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");