From 5d35ce8f934db55c98cdbfe6e81fbb16c83bc483 Mon Sep 17 00:00:00 2001 From: Gary O'Neall Date: Fri, 22 Dec 2023 12:12:55 -0800 Subject: [PATCH] Add hover text and explanation of red/blue text Fixes #165 Signed-off-by: Gary O'Neall --- resources/htmlTemplate/ExceptionHTMLTemplate.html | 14 +++++++++++++- resources/htmlTemplate/LicenseHTMLTemplate.html | 12 ++++++++++++ src/org/spdx/licensexml/LicenseXmlHelper.java | 3 +++ 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/resources/htmlTemplate/ExceptionHTMLTemplate.html b/resources/htmlTemplate/ExceptionHTMLTemplate.html index bafa9e5..34da797 100644 --- a/resources/htmlTemplate/ExceptionHTMLTemplate.html +++ b/resources/htmlTemplate/ExceptionHTMLTemplate.html @@ -167,7 +167,19 @@

Notes

{{notes}}

Text

- + +
+
+ Text in italicized blue is omittable (see Matching Guidelines B.3.5). + License or exception text will match to the text for the specified identifier if it either includes or excludes this omittable text. +
+
+ Text in red is replaceable (see Matching Guidelines B.3.4). + License or exception text will match to the text for the specified identifier if it includes a permitted variant of this replaceable text. + The permitted variants can be found in the corresponding regular expression as shown in title text visible by hovering over the red text. +
+
+
{{&text}}
diff --git a/resources/htmlTemplate/LicenseHTMLTemplate.html b/resources/htmlTemplate/LicenseHTMLTemplate.html index 8e675f9..fa066bd 100644 --- a/resources/htmlTemplate/LicenseHTMLTemplate.html +++ b/resources/htmlTemplate/LicenseHTMLTemplate.html @@ -171,6 +171,18 @@

Notes

{{notes}}{{^notes}}None{{/notes}}

Text

+ +
+
+ Text in italicized blue is omittable (see Matching Guidelines B.3.5). + License or exception text will match to the text for the specified identifier if it either includes or excludes this omittable text. +
+
+ Text in red is replaceable (see Matching Guidelines B.3.4). + License or exception text will match to the text for the specified identifier if it includes a permitted variant of this replaceable text. + The permitted variants can be found in the corresponding regular expression as shown in title text visible by hovering over the red text. +
+
{{&licenseText}} diff --git a/src/org/spdx/licensexml/LicenseXmlHelper.java b/src/org/spdx/licensexml/LicenseXmlHelper.java index e2b3516..243c0c6 100644 --- a/src/org/spdx/licensexml/LicenseXmlHelper.java +++ b/src/org/spdx/licensexml/LicenseXmlHelper.java @@ -465,6 +465,8 @@ private static boolean appendAltText(Element element, String altName, String mat sb.append(""); if (sb.length() > 0 && !Character.isWhitespace(sb.charAt(sb.length()-1)) && !noSpace && (SPACING_BOTH.equals(spacing) || SPACING_BEFORE.equals(spacing) || SPACING_DEFAULT.equals(spacing))) { @@ -474,6 +476,7 @@ private static boolean appendAltText(Element element, String altName, String mat if (SPACING_BOTH.equals(spacing) || SPACING_AFTER.equals(spacing)) { sb.append(' '); } + sb.append(""); if (includesFlowControl(element)) { sb.append("
"); } else {