parse and send page data when loading nomadnet pages

This commit is contained in:
liamcottle 2024-09-22 22:58:19 +12:00
commit 846228b2b5
2 changed files with 37 additions and 7 deletions

View file

@ -319,9 +319,13 @@ export default {
return;
}
// check if page url ends with .mu but remove page data first
// address:/page/index.mu`Data=123
const [ pagePathWithoutData, pageData ] = pagePath.split("`");
// convert micron to html if page ends with .mu extension
// otherwise, we will just serve the content as is
if(pagePath.endsWith(".mu")){
if(pagePathWithoutData.endsWith(".mu")){
this.nodePageContent = MicronParser.convertMicronToHtml(pageContent);
} else {
this.nodePageContent = pageContent;