mirror of
https://github.com/liriliri/eruda.git
synced 2026-03-24 09:48:37 +08:00
Fix: Eslint
This commit is contained in:
@@ -376,7 +376,7 @@ function formatEl(val)
|
||||
return `<pre style="display:inline">${highlight(beautify.html(val.outerHTML), 'html')}</pre>`;
|
||||
}
|
||||
|
||||
var regUrl = /(^|[\s\n]|<[A-Za-z]*\/?>)((?:https?|ftp):\/\/[\-A-Z0-9+\u0026\u2019@#\/%?=()~_|!:,.;]*[\-A-Z0-9+\u0026@#\/%=~()_|])/gi;
|
||||
var regUrl = /(^|[\s\n]|<[A-Za-z]*\/?>)((?:https?|ftp):\/\/[-A-Z0-9+\u0026\u2019@#/%?=()~_|!:,.;]*[-A-Z0-9+\u0026@#/%=~()_|])/gi;
|
||||
|
||||
var recognizeUrl = str => str.replace(regUrl, '<a href="$2" target="_blank">$2</a>');
|
||||
|
||||
|
||||
@@ -88,13 +88,13 @@ var language = {};
|
||||
language.js = {
|
||||
comment: {re: /(\/\/.*|\/\*([\s\S]*?)\*\/)/g, style: 'comment'},
|
||||
string: {re: /(('.*?')|(".*?"))/g, style: 'string'},
|
||||
numbers: {re: /(\-?(\d+|\d+\.\d+|\.\d+))/g, style: 'number'},
|
||||
numbers: {re: /(-?(\d+|\d+\.\d+|\.\d+))/g, style: 'number'},
|
||||
keywords: {re: /(?:\b)(function|for|foreach|while|if|else|elseif|switch|break|as|return|this|class|self|default|var|false|true|null|undefined)(?:\b)/gi, style: 'keyword'},
|
||||
operators: {re: /(\+|\-|\/|\*|%|=|<|>|\||\?|\.)/g, style: 'operators'}
|
||||
operators: {re: /(\+|-|\/|\*|%|=|<|>|\||\?|\.)/g, style: 'operators'}
|
||||
};
|
||||
|
||||
language.html = {
|
||||
comment: {re: /(<!\-\-([\s\S]*?)\-\->)/g, style: 'comment'},
|
||||
comment: {re: /(<!--([\s\S]*?)-->)/g, style: 'comment'},
|
||||
tag: {re: /(<\/?\w(.|\n)*?\/?>)/g, style: 'keyword', embed: ['string']},
|
||||
string: language.js.string,
|
||||
css: {re: /(?:<style.*?>)([\s\S]*)?(?:<\/style>)/gi, language: 'css'},
|
||||
@@ -104,8 +104,8 @@ language.html = {
|
||||
language.css = {
|
||||
comment: language.js.comment,
|
||||
string: language.js.string,
|
||||
numbers: {re: /((\-?(\d+|\d+\.\d+|\.\d+)(%|px|em|pt|in)?)|#[0-9a-fA-F]{3}[0-9a-fA-F]{3})/g, style: 'number'},
|
||||
keywords: {re: /(@\w+|:?:\w+|[a-z\-]+:)/g, style: 'keyword'}
|
||||
numbers: {re: /((-?(\d+|\d+\.\d+|\.\d+)(%|px|em|pt|in)?)|#[0-9a-fA-F]{3}[0-9a-fA-F]{3})/g, style: 'number'},
|
||||
keywords: {re: /(@\w+|:?:\w+|[a-z-]+:)/g, style: 'keyword'}
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user