Skip to content

Commit

Permalink
changes as requested
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveLLamb committed Oct 16, 2024
1 parent c17ea95 commit 212bd78
Showing 1 changed file with 17 additions and 14 deletions.
31 changes: 17 additions & 14 deletions smpte.js
Original file line number Diff line number Diff line change
Expand Up @@ -612,8 +612,7 @@ function insertConformance(docMetadata) {
return;
}

if (docMetadata.pubType == smpte.EG_PUBTYPE) {
if (sec !== null)
if ((docMetadata.pubType == smpte.EG_PUBTYPE) && (sec !== null)) {
logger_.error("EG must not contain a Conformance section.");
}

Expand All @@ -637,7 +636,7 @@ function insertConformance(docMetadata) {

} else {

implConformance = sec.innerText;
implConformance = sec.innerHTML;

}

Expand Down Expand Up @@ -696,18 +695,22 @@ function insertConformance(docMetadata) {

const sections = document.querySelectorAll('section');
sections.forEach((element) => {
let id = element.id;
if ((id !== "sec-front-matter") && (id !== "sec-foreword") && (id !== "sec-conformance")) {
if (element.innerText.toLowerCase().includes("shall")) {
logger_.error(`EG must not contain Conformance Notation - "shall" found`, element);
}
if (element.innerText.toLowerCase().includes("should")) {
logger_.error(`EG must not contain Conformance Notation - "should" found`, element);
}
if (element.innerText.toLowerCase().includes("may")) {
logger_.error(`EG must not contain Conformance Notation - "may" found`, element);
}

const id = element.id;

if (id === "sec-front-matter" || id === "sec-foreword" || id === "sec-conformance")
return;

if (element.innerText.toLowerCase().includes("shall")) {
logger_.error(`EG must not contain Conformance Notation - "shall" found`, element);
}
if (element.innerText.toLowerCase().includes("should")) {
logger_.error(`EG must not contain Conformance Notation - "should" found`, element);
}
if (element.innerText.toLowerCase().includes("may")) {
logger_.error(`EG must not contain Conformance Notation - "may" found`, element);
}

});
}

Expand Down

0 comments on commit 212bd78

Please sign in to comment.