Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

针对 editormd.js 中 md到Html 转换的函数形参进行了智能判断,使得其可以接收一个元素,而不仅仅是id #998

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Dec 6, 2023

  1. 针对 editormd.js 中 md到Html 转换的函数形参进行了智能判断,使得其可以接收一个元素,而不仅仅是id

    针对 editormd.js 中 md到Html 转换的函数形参进行了智能判断,使得其可以接收一个元素,而不仅仅是id,下面是主要的变更信息。
    
    # 新增函数
    新增了一个字符串对象判断函数。
    ```
        /**
         * 判断一个对象是否为字符串
         * @param obj
         * @return {boolean}
         */
        const isString = (obj) => typeof obj === 'string' || obj instanceof String;
    ```
    
    # 针对 editormd.markdownToHTML 函数进行了少量修改,使得其可以接收一个HTML的控件对象。
    ```
            var div           =  isString(id) ? $("#" + id) : $(id)
    ```
    BeardedManZhao committed Dec 6, 2023
    Configuration menu
    Copy the full SHA
    5049e52 View commit details
    Browse the repository at this point in the history