javascript - Markdown to HTML w/ syntax highlighting using Gulp -
i'm using gulp-markdown package render markdown file html partial. (it uses npm marked package actual rendering.) renders fine, except code blocks!! how gulp put out correctly formatted html?
here gulp:
var gulp = require('gulp'); var markdown = require('gulp-markdown'); markdown.marked.setoptions({ renderer: new markdown.marked.renderer(), gfm: true, tables: true, breaks: false, pedantic: false, sanitize: true, smartlists: true, smartypants: false }); // turn md files html partials gulp.task('blogposts', function () { return gulp.src('src/blog/blogone.md') .pipe(markdown()) .pipe(gulp.dest('src/partials')); });
and here markdown:
```javascript app.controller('displaycontroller', ['$scope', 'clogsservice', function($scope, clogsservice){ $scope.clogs = []; $scope.getclogs = function() { clogservice.getclogs() .then(function(response){ clogsservice.clogs = response.data; $scope.clogs = clogsservice.clogs; }); }; }) ```
here output html:
<pre><code>app.controller('displaycontroller', ['$scope', 'clogsservice', function($scope, clogsservice){ $scope.clogs = []; $scope.getclogs = function() { clogservice.getclogs() .then(function(response){ clogsservice.clogs = response.data; $scope.clogs = clogsservice.clogs; }); }; }) </code></pre>
how page render code blocks correctly syntax highlighting?
Comments
Post a Comment