tex2lyx: support to detect https:// links

- Preamble.cpp: use the occasion to backport JMarcs recent compiler warning fixe
This commit is contained in:
Uwe Stöhr 2017-12-17 02:28:54 +01:00
parent 998d39fa28
commit e73164e25d
2 changed files with 5 additions and 6 deletions

View 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))

View 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");