diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..f87b777 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "parsedown"] + path = parsedown + url = https://github.com/erusev/parsedown.git diff --git a/diary/Markdown is supported now.md b/diary/Markdown is supported now.md new file mode 100644 index 0000000..5de82ea --- /dev/null +++ b/diary/Markdown is supported now.md @@ -0,0 +1,15 @@ +We are glad to announce that ... + +# Markdown Supported + +``` javascript +for (var i = 0; i < 10; i++) { + document.write("Hello from Inndy (" + i + ")
"); +} +``` + +~~Line-through test~~ *Italic* **Bold** ***ItalicBold*** + +--- + +Markdown renderer takes from [parsedown](https://github.com/erusev/parsedown). diff --git a/index.php b/index.php index ed76d68..fbac168 100644 --- a/index.php +++ b/index.php @@ -1,4 +1,5 @@ text(file_get_contents($Diary)); + break; + case 'txt': + case 'text': + $Content = nl2br(file_get_contents($Diary)); + break; + } + + if ($Content === null) { + continue; // Skip invalid file type + } /** Get the unix timestramp of the file */ $Date = filemtime($Diary); diff --git a/parsedown b/parsedown new file mode 160000 index 0000000..65116c3 --- /dev/null +++ b/parsedown @@ -0,0 +1 @@ +Subproject commit 65116c3cb0953447eac742aa4ea5fc4aaaa22db9