blog-hexo/themes/hexo-theme-cosy/scripts/road-to-json.js

7 lines
206 B
JavaScript
Raw Normal View History

2023-10-25 22:05:16 +08:00
hexo.extend.helper.register('road_to_json', (roadObj) => {
return !roadObj ? 'null' : JSON.stringify(roadObj)
.replace(/</g, '\\u003c')
.replace(/>/g, '\\u003e')
.replace(/&/g, '\\u0026')
});