[LyX/master] InsetHyperlink: make sure there is always some text in the link.
Thibaut Cuvelier <[email protected]>
| Newsgroups | gmane.editors.lyx.cvs |
|---|---|
| Message-ID | <[email protected]> |
commit 6afbc981ca9ee1b50264f6648b50347ac7a5d456 Author: Thibaut Cuvelier <[email protected]> Date: Fri Mar 6 19:22:21 2026 +0100 InsetHyperlink: make sure there is always some text in the link. export/examples/ja/Modules/Linguistics had links with a `mailto` `href`, but no actual content. --- src/insets/InsetHyperlink.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/insets/InsetHyperlink.cpp b/src/insets/InsetHyperlink.cpp index 1d51d6ac32..aeb63313d9 100644 --- a/src/insets/InsetHyperlink.cpp +++ b/src/insets/InsetHyperlink.cpp @@ -238,7 +238,11 @@ void InsetHyperlink::docbook(XMLStream & xs, OutputParams const &) const { docstring target = subst(getParam("target"), from_ascii("&"), from_ascii("&")) ; xs << xml::StartTag("link", "xlink:href=\"" + makeURL(target, getParam("type")) + "\""); - xs << xml::escapeString(getParam("name")); + if (!getParam("name").empty()) { + xs << xml::escapeString(getParam("name")); + } else { + xs << xml::escapeString(getParam("type")); + } xs << xml::EndTag("link"); } -- lyx-cvs mailing list [email protected] https://lists.lyx.org/mailman/listinfo/lyx-cvs