Parse preview markdown with filter

This commit is contained in:
Thomas Wade 2018-10-30 18:12:10 +10:30
parent 14233b6954
commit 9f8ab3466b
2 changed files with 3 additions and 3 deletions

View File

@ -97,8 +97,8 @@ app.controller("create", ["$scope", "$http",
{ {
// Only parse if there is content and if the preview is toggling on // Only parse if there is content and if the preview is toggling on
return $scope.content && $scope.previewing return $scope.content && $scope.previewing
? marked($scope.content) ? $scope.content
: ""; : " ";
} }
} }
} }

View File

@ -19,7 +19,7 @@
</span> </span>
<br> <br>
<textarea class="content" ng-model="content" ng-hide="previewing" placeholder="Post content.&#13;&#10;Markdown supported!" required></textarea> <textarea class="content" ng-model="content" ng-hide="previewing" placeholder="Post content.&#13;&#10;Markdown supported!" required></textarea>
<div class="preview" ng-bind-html="previewHtml()" ng-show="previewing"></div> <div class="preview" ng-bind-html="previewHtml() | markdown" ng-show="previewing"></div>
<br> <br>
<div class="buttonContainer"> <div class="buttonContainer">
<button type="submit" ng-disabled="previewing">Submit</button> <button type="submit" ng-disabled="previewing">Submit</button>