Skip to content

Commit

Permalink
Fix: NotificationUi file broken areas
Browse files Browse the repository at this point in the history
  • Loading branch information
devvaannsh authored and abose committed Sep 18, 2024
1 parent 11fa1d0 commit 24b5640
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 29 deletions.
28 changes: 0 additions & 28 deletions build/api-docs-generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -516,34 +516,6 @@ generateMdxFiles();

console.log("Redundant files generated for conversion process are removed!");

const notificationUIPath = './build/api/widgets/NotificationUI.mdx';

/**
* fix notification UI broken areas
* NotificationUI file has some issues and mdx is not being rendered properly. Fixing it.
* Removing a line where docusaurus throws error
* Removing </br> tag that's within div tag. Only two instances of this in whole project, so fixing it by searching for the exact line instead of writing a logic (as the logic may disturb content from other files)
* @param {string} filePath
*/
function fixNotificationUiFile(filePath) {
try {
// Read the file synchronously
let content = fs.readFileSync(filePath, 'utf8');

// Fix notification UI broken areas
content = content.replace('ame="badge badge--info margin-left--sm">static</span><br/><a href="#done">done</a><span className="badge badge--info margin-left--sm">static</span></div></div>\n</div>', '');

// Write the file synchronously
fs.writeFileSync(filePath, content, 'utf8');

console.log("Successfully fixed the issues inside notificationUI file");
} catch (err) {
console.error('Error while fixing notificationUI file', err);
}
}

fixNotificationUiFile(notificationUIPath);


/**
* Moves all MDX files and subfolders to a specified destination folder.
Expand Down
1 change: 0 additions & 1 deletion src/widgets/NotificationUI.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ define(function (require, exports, module) {
* This is an instance of the notification returned by the `createFromTemplate` call. The object can be used to
* control the created notification. See Notification docs below.
* @type {Object}
* @name Notification
*/

/**
Expand Down

0 comments on commit 24b5640

Please sign in to comment.