Skip to content

Commit bd6c097

Browse files
committed
Merge branch 'main' of github.com:adobe/da-nx
2 parents d6d040a + 86bccfa commit bd6c097

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

nx/blocks/loc/connectors/glaas/dnt.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,8 @@ const addDntInfoToHtml = (html) => {
223223
document.querySelector('footer')?.remove();
224224

225225
globalDntConfig.get('docRules').forEach((operations, selector) => {
226-
addDntAttribute(selector, operations, document);
226+
const newSelector = selector.startsWith('.* >') ? selector.replace('.* >', 'div[class] >') : selector;
227+
addDntAttribute(newSelector, operations, document);
227228
});
228229
globalDntConfig.get('contentRules').forEach((content) => {
229230
findAndAddDntWrapper(document, content);

nx/blocks/loc/views/translate/index.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,13 @@ export async function getUrls(org, site, service, sourceLocation, urls, fetchCon
5454

5555
// Only add DNT if a connector exists
5656
// Copy sources will not have a connector
57+
url.content = content;
5758
if (connector) {
58-
url.content = await connector.dnt.addDnt(content, config, { fileType });
59-
} else {
60-
url.content = content;
59+
try {
60+
url.content = await connector.dnt.addDnt(content, config, { fileType });
61+
} catch (error) {
62+
url.error = `Error adding DNT to ${url.daBasePath} - ${error.message}`;
63+
}
6164
}
6265
};
6366

0 commit comments

Comments
 (0)