Add anchor ids to headers

This commit is contained in:
KingOfDog 2020-10-11 12:22:14 +02:00
parent 91b7922464
commit fcf12f7dcf
10 changed files with 74 additions and 72 deletions

View File

@ -160,13 +160,6 @@ module.exports = !DESCRIPTORS && !fails(function () {
});
/***/ }),
/***/ "0da5":
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/***/ "1276":
@ -338,6 +331,26 @@ module.exports = function (R, S) {
/***/ }),
/***/ "18a5":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var $ = __webpack_require__("23e7");
var createHTML = __webpack_require__("857a");
var forcedStringHTMLMethod = __webpack_require__("af03");
// `String.prototype.anchor` method
// https://tc39.github.io/ecma262/#sec-string.prototype.anchor
$({ target: 'String', proto: true, forced: forcedStringHTMLMethod('anchor') }, {
anchor: function anchor(name) {
return createHTML(this, 'a', 'name', name);
}
});
/***/ }),
/***/ "1c0b":
@ -18460,17 +18473,6 @@ module.exports = !fails(function () {
});
/***/ }),
/***/ "8401":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_MathBlock_vue_vue_type_style_index_0_id_59e6cee5_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("0da5");
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_MathBlock_vue_vue_type_style_index_0_id_59e6cee5_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_MathBlock_vue_vue_type_style_index_0_id_59e6cee5_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0__);
/* unused harmony reexport * */
/* unused harmony default export */ var _unused_webpack_default_export = (_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_MathBlock_vue_vue_type_style_index_0_id_59e6cee5_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0___default.a);
/***/ }),
/***/ "857a":
@ -19832,11 +19834,18 @@ var EmbedBlock_component = normalizeComponent(
)
/* harmony default export */ var EmbedBlock = (EmbedBlock_component.exports);
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.string.anchor.js
var es_string_anchor = __webpack_require__("18a5");
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/HeaderBlock.vue?vue&type=script&lang=js&
/* harmony default export */ var HeaderBlockvue_type_script_lang_js_ = ({
props: ["data"],
render: function render(createElement) {
return createElement("h" + this.data.level, {
attrs: {
id: this.data.anchor
},
domProps: {
innerHTML: this.data.text
}
@ -20010,12 +20019,12 @@ var ListBlock_component = normalizeComponent(
)
/* harmony default export */ var ListBlock = (ListBlock_component.exports);
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"0e1ca7e0-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/MathBlock.vue?vue&type=template&id=59e6cee5&scoped=true&
var MathBlockvue_type_template_id_59e6cee5_scoped_true_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('figure',[_c('div',{domProps:{"innerHTML":_vm._s(_vm.content)}})])}
var MathBlockvue_type_template_id_59e6cee5_scoped_true_staticRenderFns = []
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"0e1ca7e0-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/MathBlock.vue?vue&type=template&id=485c2336&
var MathBlockvue_type_template_id_485c2336_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('figure',[_c('div',{domProps:{"innerHTML":_vm._s(_vm.content)}})])}
var MathBlockvue_type_template_id_485c2336_staticRenderFns = []
// CONCATENATED MODULE: ./src/components/MathBlock.vue?vue&type=template&id=59e6cee5&scoped=true&
// CONCATENATED MODULE: ./src/components/MathBlock.vue?vue&type=template&id=485c2336&
// EXTERNAL MODULE: ./node_modules/katex/dist/katex.js
var katex = __webpack_require__("3b2f");
@ -20044,25 +20053,21 @@ var katex_default = /*#__PURE__*/__webpack_require__.n(katex);
});
// CONCATENATED MODULE: ./src/components/MathBlock.vue?vue&type=script&lang=js&
/* harmony default export */ var components_MathBlockvue_type_script_lang_js_ = (MathBlockvue_type_script_lang_js_);
// EXTERNAL MODULE: ./src/components/MathBlock.vue?vue&type=style&index=0&id=59e6cee5&scoped=true&lang=css&
var MathBlockvue_type_style_index_0_id_59e6cee5_scoped_true_lang_css_ = __webpack_require__("8401");
// CONCATENATED MODULE: ./src/components/MathBlock.vue
/* normalize component */
var MathBlock_component = normalizeComponent(
components_MathBlockvue_type_script_lang_js_,
MathBlockvue_type_template_id_59e6cee5_scoped_true_render,
MathBlockvue_type_template_id_59e6cee5_scoped_true_staticRenderFns,
MathBlockvue_type_template_id_485c2336_render,
MathBlockvue_type_template_id_485c2336_staticRenderFns,
false,
null,
"59e6cee5",
null,
null
)

File diff suppressed because one or more lines are too long

View File

@ -1 +0,0 @@
.katex-html[data-v-59e6cee5]{display:none}

View File

@ -169,13 +169,6 @@ module.exports = !DESCRIPTORS && !fails(function () {
});
/***/ }),
/***/ "0da5":
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/***/ "1276":
@ -347,6 +340,26 @@ module.exports = function (R, S) {
/***/ }),
/***/ "18a5":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var $ = __webpack_require__("23e7");
var createHTML = __webpack_require__("857a");
var forcedStringHTMLMethod = __webpack_require__("af03");
// `String.prototype.anchor` method
// https://tc39.github.io/ecma262/#sec-string.prototype.anchor
$({ target: 'String', proto: true, forced: forcedStringHTMLMethod('anchor') }, {
anchor: function anchor(name) {
return createHTML(this, 'a', 'name', name);
}
});
/***/ }),
/***/ "1c0b":
@ -18469,17 +18482,6 @@ module.exports = !fails(function () {
});
/***/ }),
/***/ "8401":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_MathBlock_vue_vue_type_style_index_0_id_59e6cee5_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("0da5");
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_MathBlock_vue_vue_type_style_index_0_id_59e6cee5_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_MathBlock_vue_vue_type_style_index_0_id_59e6cee5_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0__);
/* unused harmony reexport * */
/* unused harmony default export */ var _unused_webpack_default_export = (_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_MathBlock_vue_vue_type_style_index_0_id_59e6cee5_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0___default.a);
/***/ }),
/***/ "857a":
@ -19841,11 +19843,18 @@ var EmbedBlock_component = normalizeComponent(
)
/* harmony default export */ var EmbedBlock = (EmbedBlock_component.exports);
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.string.anchor.js
var es_string_anchor = __webpack_require__("18a5");
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/HeaderBlock.vue?vue&type=script&lang=js&
/* harmony default export */ var HeaderBlockvue_type_script_lang_js_ = ({
props: ["data"],
render: function render(createElement) {
return createElement("h" + this.data.level, {
attrs: {
id: this.data.anchor
},
domProps: {
innerHTML: this.data.text
}
@ -20019,12 +20028,12 @@ var ListBlock_component = normalizeComponent(
)
/* harmony default export */ var ListBlock = (ListBlock_component.exports);
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"0e1ca7e0-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/MathBlock.vue?vue&type=template&id=59e6cee5&scoped=true&
var MathBlockvue_type_template_id_59e6cee5_scoped_true_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('figure',[_c('div',{domProps:{"innerHTML":_vm._s(_vm.content)}})])}
var MathBlockvue_type_template_id_59e6cee5_scoped_true_staticRenderFns = []
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"0e1ca7e0-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/MathBlock.vue?vue&type=template&id=485c2336&
var MathBlockvue_type_template_id_485c2336_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('figure',[_c('div',{domProps:{"innerHTML":_vm._s(_vm.content)}})])}
var MathBlockvue_type_template_id_485c2336_staticRenderFns = []
// CONCATENATED MODULE: ./src/components/MathBlock.vue?vue&type=template&id=59e6cee5&scoped=true&
// CONCATENATED MODULE: ./src/components/MathBlock.vue?vue&type=template&id=485c2336&
// EXTERNAL MODULE: ./node_modules/katex/dist/katex.js
var katex = __webpack_require__("3b2f");
@ -20053,25 +20062,21 @@ var katex_default = /*#__PURE__*/__webpack_require__.n(katex);
});
// CONCATENATED MODULE: ./src/components/MathBlock.vue?vue&type=script&lang=js&
/* harmony default export */ var components_MathBlockvue_type_script_lang_js_ = (MathBlockvue_type_script_lang_js_);
// EXTERNAL MODULE: ./src/components/MathBlock.vue?vue&type=style&index=0&id=59e6cee5&scoped=true&lang=css&
var MathBlockvue_type_style_index_0_id_59e6cee5_scoped_true_lang_css_ = __webpack_require__("8401");
// CONCATENATED MODULE: ./src/components/MathBlock.vue
/* normalize component */
var MathBlock_component = normalizeComponent(
components_MathBlockvue_type_script_lang_js_,
MathBlockvue_type_template_id_59e6cee5_scoped_true_render,
MathBlockvue_type_template_id_59e6cee5_scoped_true_staticRenderFns,
MathBlockvue_type_template_id_485c2336_render,
MathBlockvue_type_template_id_485c2336_staticRenderFns,
false,
null,
"59e6cee5",
null,
null
)

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,7 +1,7 @@
{
"name": "block-renderer",
"description": "Content renderer for JSON blocks from Editor.js",
"version": "0.1.20",
"version": "0.2.2",
"author": "KingOfDog <info@kingofdog.de>",
"repository": {
"type": "git",

View File

@ -3,10 +3,9 @@ export default {
props: ["data"],
render(createElement) {
return createElement("h" + this.data.level, {
attrs: { id: this.data.anchor },
domProps: { innerHTML: this.data.text }
});
}
};
</script>
<style></style>

View File

@ -21,9 +21,3 @@ export default {
}
};
</script>
<style scoped>
.katex-html {
display: none;
}
</style>