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

each code line taged by pre #178

Open
fuyunliu opened this issue Jun 27, 2019 · 2 comments
Open

each code line taged by pre #178

fuyunliu opened this issue Jun 27, 2019 · 2 comments

Comments

@fuyunliu
Copy link

i think we want just one pre tag

@fuyunliu
Copy link
Author

better:
multi code line with just one pre tag
if you want another code block, just click again.

@algorys
Copy link

algorys commented Jul 3, 2019

@fuyunliu due to a problem with PRE in Firefox who put one PRE block by line, I've make this little function for code button:

{
    name: 'code',
    icon: '<i class="fa fa-fw fa-code"></i>',
    result: function() {
        if (window.getSelection) {
            let linesCode = window.getSelection().toString().split('\n').join('<br>');
            document.execCommand('insertHTML', false, '<pre>' + linesCode + '</pre>');
        } else {
            document.execCommand('formatBlock', false, '<PRE>');
        }
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants