Skip to content

Commit

Permalink
fix: assets setting for in-article images
Browse files Browse the repository at this point in the history
  • Loading branch information
ikeq committed Oct 16, 2020
1 parent 66de711 commit a26edf3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions lib/renderer/markdown/index.js
Expand Up @@ -13,6 +13,7 @@ module.exports = function (data) {
return renderer.render(data.text, {
theme: hexo.theme.config,
styles: hexo.theme.config.runtime.styles,
uriReplacer: hexo.theme.config.runtime.uriReplacer,
getHeadingId: new function () {
const map = {};
return (title) => {
Expand Down
4 changes: 3 additions & 1 deletion lib/renderer/markdown/mixins.js
Expand Up @@ -28,7 +28,7 @@ module.exports = function mixins(md, config) {

md.core.ruler.after('inline', 'inside', function (state) {
const { tokens, env } = state;
const { theme, styles, getHeadingId } = env;
const { theme, styles, getHeadingId, uriReplacer } = env;

for (let i = 0; i < tokens.length; i++) {
const token = tokens[i];
Expand All @@ -40,6 +40,8 @@ module.exports = function mixins(md, config) {
const title = inlineToken.attrGet('title');
const data = parsePipe(title);

inlineToken.attrSet('src', uriReplacer(inlineToken.attrGet('src')));

/**
* hint for:
* ```md
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "hexo-theme-inside",
"version": "2.7.0-beta.7",
"version": "2.7.0-beta.8",
"description": "鉂わ笍 SPA, flat and clean theme for Hexo.",
"scripts": {
"test": "jasmine --config=test/jasmine.json"
Expand Down

0 comments on commit a26edf3

Please sign in to comment.