Skip to content

Commit 2ad3af0

Browse files
committed
refactor: remove debug logs to improve code clarity
1 parent b065905 commit 2ad3af0

File tree

5 files changed

+1
-21
lines changed

5 files changed

+1
-21
lines changed

js/markdownParser.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
/**
2-
* Converts markdown text to HTML
3-
* @param {string} inputMarkdown - The markdown text to convert
4-
* @returns {string} The converted HTML
5-
*/
61
export function markdownToHTML(inputMarkdown) {
72
if (!inputMarkdown) return "";
83

utils/historyManager.js

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,9 @@ let currentIndex = -1;
44
// track current index of the history array
55
export const addState = (state) => {
66
if (history[currentIndex] !== state) {
7-
history.splice(currentIndex + 1);
8-
9-
console.log('history index', history[currentIndex]);
107

8+
history.splice(currentIndex + 1);
119
history.push(state);
12-
1310
currentIndex = history.length - 1;
1411
}
1512
}
@@ -18,8 +15,6 @@ export const undo = () => {
1815
if (currentIndex > 0) {
1916
currentIndex--;
2017

21-
console.log('undo - history cI:', history[currentIndex]);
22-
2318
// return the previous state
2419
return history[currentIndex];
2520
}
@@ -30,8 +25,6 @@ export const redo = () => {
3025
if (currentIndex < history.length - 1) {
3126
currentIndex++;
3227

33-
console.log('REDO - history cI:', history[currentIndex]);
34-
3528
// return the next state
3629
return history[currentIndex];
3730
}

utils/localStorageHelper.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,14 @@ const locSTG_KEY = CONFIG.STG_KEY || 'defKey';
66

77
export const saveSTG = (outputHTML) => {
88
try {
9-
console.log('saveSTG:', outputHTML);
109
localStorage.setItem(locSTG_KEY, outputHTML);
11-
console.info('outputHTML saved');
1210
} catch (error) {
1311
console.error('Error saving to localStorage:', error);
1412
}
1513
}
1614

1715
export const loadSTG = () => {
1816
try {
19-
console.log('loadSTG called.');
2017
return localStorage.getItem(locSTG_KEY);
2118
}
2219
catch (error) {
@@ -27,7 +24,6 @@ export const loadSTG = () => {
2724

2825
export const clearSTG = () => {
2926
try {
30-
localStorage.removeItem(locSTG_KEY);
3127
console.info('Storage cleared ');
3228
} catch (error) {
3329
console.error('Error clearing localStorage:', error);

utils/themeManager.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ export const setTheme = (theme) => {
1616
themeToggleButton.innerHTML = theme === 'dark-mode' ? '☀️' : '🌙';
1717
}
1818

19-
console.info('theme set to:', theme);
2019
};
2120

2221
// theme getter

utils/wordCounter.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@ export const countWords = (text) => {
66
.replace(/```([\s\S]*?)```/g, '')
77
.replace(/`([^`]+)`/g, '');
88

9-
10-
console.info('cleanText', cleanText);
11-
129
// count words
1310
return cleanText.trim().split(/\s+/).filter(Boolean).length;
1411
};

0 commit comments

Comments
 (0)