commit 6c6cf5e07136fd1b74c19ef142cf18e1f3723de7
Author: Uwe Stöhr <[email protected]>
Date: Sun Dec 17 02:24:26 2017 +0100
use https:// in the first line of .lyx files
- also support to detect https via tex2lyx
---
lib/lyx2lyx/LyX.py | 2 +-
src/Buffer.cpp | 12 ++++++------
src/tex2lyx/Preamble.cpp | 4 ++--
src/tex2lyx/text.cpp | 4 ++--
4 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/lib/lyx2lyx/LyX.py b/lib/lyx2lyx/LyX.py
index c76fc58..98111d6 100644
--- a/lib/lyx2lyx/LyX.py
+++ b/lib/lyx2lyx/LyX.py
@@ -533,7 +533,7 @@ class LyX_base:
" Set the header with the version used."
initial_comment = " ".join(["#LyX %s created this file." % version__,
- "For more info see http://www.lyx.org/"])
+ "For more info see https://www.lyx.org/"])
# Simple heuristic to determine the comment that always starts
# a lyx file
diff --git a/src/Buffer.cpp b/src/Buffer.cpp
index 79ceb9b..294c7a1 100644
--- a/src/Buffer.cpp
+++ b/src/Buffer.cpp
@@ -1610,7 +1610,7 @@ bool Buffer::write(ostream & ofs) const
// Important: Keep the version formatting in sync with lyx2lyx and
// tex2lyx (bug 7951)
ofs << "#LyX " << lyx_version_major << "." << lyx_version_minor
- << " created this file. For more info see http://www.lyx.org/\n"
+ << " created this file. For more info see https://www.lyx.org/\n"
<< "\\lyxformat " << LYX_FORMAT << "\n"
<< "\\begin_document\n";
@@ -1794,7 +1794,7 @@ void Buffer::writeLaTeXSource(otexstream & os,
// first paragraph of the document. (Asger)
if (output_preamble && runparams.nice) {
os << "%% LyX " << lyx_version << " created this file. "
- "For more info, see http://www.lyx.org/.\n"
+ "For more info, see https://www.lyx.org/.\n"
"%% Do not edit unless you really know what "
"you are doing.\n";
}
@@ -2038,7 +2038,7 @@ void Buffer::writeDocBookSource(odocstream & os, string
const & fname,
os << from_ascii(tclass.class_header());
else if (runparams.flavor == OutputParams::XML)
os << "PUBLIC \"-//OASIS//DTD DocBook XML V4.2//EN\" "
- <<
"\"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd\"";
+ <<
"\"https://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd\"";
else
os << " PUBLIC \"-//OASIS//DTD DocBook V4.2//EN\"";
@@ -2077,7 +2077,7 @@ void Buffer::writeDocBookSource(odocstream & os, string
const & fname,
os << "<!-- " << ((runparams.flavor == OutputParams::XML)?
"XML" : "SGML")
<< " file was created by LyX " << lyx_version
- << "\n See http://www.lyx.org/ for more
information -->\n";
+ << "\n See https://www.lyx.org/ for more
information -->\n";
params().documentClass().counters().reset();
@@ -4646,7 +4646,7 @@ void Buffer::updateBuffer(UpdateScope scope, UpdateType
utype) const
// not updated during the updateBuffer call and
TocModel::toc_ is invalid
// (bug 5699). The same happens if the master buffer is
open in a different
// window. This test catches both possibilities.
- // See:
http://marc.info/?l=lyx-devel&m=138590578911716&w=2
+ // See:
https://marc.info/?l=lyx-devel&m=138590578911716&w=2
// There remains a problem here: If there is another
child open in yet a third
// window, that TOC is not updated. So some more
general solution is needed at
// some point.
@@ -5087,7 +5087,7 @@ int Buffer::charCount(bool with_blanks) const
Buffer::ReadStatus Buffer::reload()
{
setBusy(true);
- // c.f. bug http://www.lyx.org/trac/ticket/6587
+ // c.f. bug https://www.lyx.org/trac/ticket/6587
removeAutosaveFile();
// e.g., read-only status could have changed due to version control
d->filename.refresh();
diff --git a/src/tex2lyx/Preamble.cpp b/src/tex2lyx/Preamble.cpp
index 2b5d706..fe722f4 100644
--- a/src/tex2lyx/Preamble.cpp
+++ b/src/tex2lyx/Preamble.cpp
@@ -1113,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");