Skip to content

Commit

Permalink
Add Java-Logic-Features
Browse files Browse the repository at this point in the history
  • Loading branch information
manuth committed Apr 3, 2017
1 parent a11515c commit 34cdff2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how
## 0.0.7
- Added malformated FrontMatter-Recognition
- Improved the MarkDown-document-detection
- Added JavaScript-logic-variables

<!--- References -->
[MarkdownItCheckbox]: https://www.npmjs.com/package/markdown-it-checkbox
13 changes: 12 additions & 1 deletion src/Document.ts
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,18 @@ export class Document extends Base
{
value = new DateTimeFormatter(this.Locale).Format(this.DateFormat, value);
}
view[key] =value;
else if (/function[\s]*\(\)[\s]*{([\s\S]*)}/gm.test(value))
{
value = value.replace(/function[\s]*\(\)[\s]*{([\s\S]*)}/gm, '$1');
value = new Function(value);

if (eval('value()') instanceof Date)
{
value = new DateTimeFormatter(this.Locale).Format(this.DateFormat, value());
}
}

view[key] = value;
}

let html = md.render(content);
Expand Down

0 comments on commit 34cdff2

Please sign in to comment.