Giter Club home page Giter Club logo

Comments (6)

qt06 avatar qt06 commented on August 16, 2024 4

这里是否可以加一个选项,默认转意所有。如果需要,可以关闭这个功能呢?

from hyperdown.

joyqi avatar joyqi commented on August 16, 2024

是的,hyperdown由于是在SegmentFault上发展出来的,由于优先考虑安全问题,我们默认转义了全部的html标签

from hyperdown.

ihewro avatar ihewro commented on August 16, 2024

同意楼上,对于typecho博客就不用转义了 不然非常麻烦

from hyperdown.

qt06 avatar qt06 commented on August 16, 2024

貌似typecho 里已经解决了这个问题吧?

from hyperdown.

tn233 avatar tn233 commented on August 16, 2024

那这样的话能不能像楼上那样说的加个转义选项,有时候分享下音乐会用到网易云音乐的外链iframe,如果不转义很麻烦....

from hyperdown.

donghaichen avatar donghaichen commented on August 16, 2024
$parser = new HyperDown\Parser;
$parser->enableHtml(true);
$parser->_commonWhiteList .= '|img|cite|embed|iframe|video|source';
$parser->_specialWhiteList = array_merge($parser->_specialWhiteList, array(
                'ol'            =>  'ol|li',
                'ul'            =>  'ul|li',
                'blockquote'    =>  'blockquote',
                'pre'           =>  'pre|code'
    ));

重点是第三行

from hyperdown.

Related Issues (20)

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.