Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
$http.get(postItem.url).then(function (res) {
var rawPost = res.data;
var decodedContent = base64.decode(rawPost.content);
rawPost.editUrl = rawPost.html_url.replace('blob', 'edit');
rawPost.content = decodedContent.split('---')[2];
rawPost.myHTML = marked(rawPost.content);
rawPost.meta = jsyaml.load(decodedContent.split('---')[1]);
postItem.postContent = rawPost;
}
)
function _parseContent(separator, rawContent) {
const splitResult = rawContent.split(separator);
return {
matter: jsyaml.load(splitResult[1]),
content: splitResult.slice(2).join(separator)
}
}
}
function (response) {
angular.module('config', []).constant('CONFIG', jsyaml.load(response.data));
angular.element(document).ready(function () {
angular.module('app', [
ngAnimate,
ngFx,
ngSanitize,
ngCache,
ngMarked,
ngDisqus,
ngLoadingBar,
angulartics,
'angulartics.google.analytics',
'720kb.socialshare',
'ja.qr',
'ngAudio',
'ngUiAwesome',
Configs.name,