Giter Site home page Giter Site logo

hexo-asset-img's Introduction

hexo-asset-img's People

Contributors

rchangl avatar unparalleled-calvin avatar yiyungent avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

hexo-asset-img's Issues

路径中有空格时,因为markdown需要encode空格的原因,会匹配失败

var regExp = RegExp("!\\[(.*?)\\]\\(" + fileName + '/(.+?)\\)', "g");

如果图片路径有空格,比如 ![](t a/a.png),在markdown中需要encode空格,就变成了 ![](t%20a/a.png)。这时候就会匹配失败,导致没法替换成功。

个人试着修改了下,简单的改成

    // ![example](postname/example.jpg)  -->  {% asset_img example.jpg example %}
    var regExp = RegExp("!\\[+?(.*?)\\]+?\\((" + fileName + "|" + fileName.replace(" ", "%20") + ')/(.+?)\\)', "g");
    // hexo g
    data.content = data.content.replace(regExp, "{% asset_img $3 $1 %}","g");

是可以成功的,希望作者能完善下这个的匹配。

[email protected] 生成时报错

ERROR Plugin load failed: hexo-asset-img
TypeError: require(...) is not a function
at C:\path\to\dir\node_modules\hexo-asset-img\index.js:1:97
at C:\path\to\dir\node_modules\hexo\dist\hexo\index.js:248:20
at tryCatcher (C:\path\to\dir\node_modules\bluebird\js\release\util.js:16:23)
at Promise._settlePromiseFromHandler (C:\path\to\dir\node_modules\bluebird\js\release\promise.js:547:31)
at Promise._settlePromise (C:\path\to\dir\node_modules\bluebird\js\release\promise.js:604:18)
at Promise._settlePromise0 (C:\path\to\dir\node_modules\bluebird\js\release\promise.js:649:10)
at Promise._settlePromises (C:\path\to\dir\node_modules\bluebird\js\release\promise.js:729:18)
at _drainQueueStep (C:\path\to\dir\node_modules\bluebird\js\release\async.js:93:12)
at _drainQueue (C:\path\to\dir\node_modules\bluebird\js\release\async.js:86:9)
at Async._drainQueues (C:\path\to\dir\node_modules\bluebird\js\release\async.js:102:5)
at Immediate.Async.drainQueues [as _onImmediate] (C:\path\to\dir\node_modules\bluebird\js\release\async.js:15:14)
at processImmediate (node:internal/timers:466:21)

[email protected]
├── @next-theme/[email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
└── [email protected]

研究了一下是因为7.0.0的hexo升级了hexo-log组件,有了新的用法,需要使用 const log = require('hexo-log').default({ 'debug': false, 'slient': false });

能不能不要转换文本中的md格式?

下面是代码块,里面是文本,但我不希望转换文本的格式

![image-20210922195056513](如何在github上搭博客/image-20210922195056513.png)

下面是图片,可以转换
image-20210922195056513

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.