File tree Expand file tree Collapse file tree 5 files changed +1
-21
lines changed Expand file tree Collapse file tree 5 files changed +1
-21
lines changed Original file line number Diff line number Diff line change 1- /**
2- * Converts markdown text to HTML
3- * @param {string } inputMarkdown - The markdown text to convert
4- * @returns {string } The converted HTML
5- */
61export function markdownToHTML ( inputMarkdown ) {
72 if ( ! inputMarkdown ) return "" ;
83
Original file line number Diff line number Diff line change @@ -4,12 +4,9 @@ let currentIndex = -1;
44// track current index of the history array
55export 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 }
Original file line number Diff line number Diff line change @@ -6,17 +6,14 @@ const locSTG_KEY = CONFIG.STG_KEY || 'defKey';
66
77export 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
1715export 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
2825export const clearSTG = ( ) => {
2926 try {
30- localStorage . removeItem ( locSTG_KEY ) ;
3127 console . info ( 'Storage cleared ' ) ;
3228 } catch ( error ) {
3329 console . error ( 'Error clearing localStorage:' , error ) ;
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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} ;
You can’t perform that action at this time.
0 commit comments