22
33import com .jtdev .website .model .BlogMetadata ;
44import com .jtdev .website .model .PortfolioMetadata ;
5+ import com .vladsch .flexmark .ext .tables .TablesExtension ;
56import com .vladsch .flexmark .html .HtmlRenderer ;
67import com .vladsch .flexmark .parser .Parser ;
78import com .vladsch .flexmark .util .ast .Node ;
@@ -72,6 +73,7 @@ public String getMarkdownContent(String path) throws IOException {
7273
7374 // Parse markdown and convert to ASCII-friendly format
7475 MutableDataSet options = new MutableDataSet ();
76+ options .set (Parser .EXTENSIONS , java .util .Arrays .asList (TablesExtension .create ()));
7577 Parser parser = Parser .builder (options ).build ();
7678 HtmlRenderer renderer = HtmlRenderer .builder (options ).build ();
7779
@@ -150,8 +152,8 @@ private String convertHtmlToAscii(String html, String dir) {
150152
151153 // Handle images without src
152154 text = text .replaceAll ("<img[^>]*>" , "[Image]" );
153- text
154155
156+ text = text
155157 // Remove any remaining HTML tags
156158 .replaceAll ("<[^>]+>" , "" )
157159
@@ -162,8 +164,7 @@ private String convertHtmlToAscii(String html, String dir) {
162164 .replaceAll ("\\ n{3,}" , "\n \n " )
163165 .trim ();
164166
165- // The formatting is already handled in the regex replacements above
166- return text .trim ();
167+ return text ;
167168 }
168169
169170 private String formatNestedLists (String html ) {
0 commit comments