Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/compile.js
Original file line number Diff line number Diff line change
Expand Up @@ -408,8 +408,8 @@ function extCss(content, callback, file) {
* 标准化处理 html 内容, 识别各种语法,并将其转换成中间码。
*
* - `<!--inline[path]-->` to embed resource content
* - `<img|embed|audio|video|link|object ... (data-)?src="path"/>` to locate resource
* - `<img|embed|audio|video|link|object ... (data-)?src="path?__inline"/>` to embed resource content
* - `<img|image|cover-image|embed|audio|video|link|object ... (data-)?src="path"/>` to locate resource
* - `<img|image|cover-image|embed|audio|video|link|object ... (data-)?src="path?__inline"/>` to embed resource content
* - `<script|style ... src="path"></script|style>` to locate js|css resource
* - `<script|style ... src="path?__inline"></script|style>` to embed js|css resource
* - `<script|style ...>...</script|style>` to analyse as js|css
Expand All @@ -420,7 +420,7 @@ function extCss(content, callback, file) {
* @memberOf fis.compile
*/
function extHtml(content, callback, file) {
var reg = /(<script(?:(?=\s)[\s\S]*?["'\s\w\/\-]>|>))([\s\S]*?)(?=<\/script\s*>|$)|(<style(?:(?=\s)[\s\S]*?["'\s\w\/\-]>|>))([\s\S]*?)(?=<\/style\s*>|$)|<(img|embed|audio|video|link|object|source)\s+[\s\S]*?["'\s\w\/\-](?:>|$)|<!--inline\[([^\]]+)\]-->|(<!(?:--)?\[[^>]+>)|<!--(?!\[|>)([\s\S]*?)(-->|$)|\bstyle\s*=\s*("(?:[^\\"\r\n\f]|\\[\s\S])+"|'(?:[^\\'\n\r\f]|\\[\s\S])+')/ig;
var reg = /(<script(?:(?=\s)[\s\S]*?["'\s\w\/\-]>|>))([\s\S]*?)(?=<\/script\s*>|$)|(<style(?:(?=\s)[\s\S]*?["'\s\w\/\-]>|>))([\s\S]*?)(?=<\/style\s*>|$)|<(img|image|cover\-image|embed|audio|video|link|object|source)\s+[\s\S]*?["'\s\w\/\-](?:>|$)|<!--inline\[([^\]]+)\]-->|(<!(?:--)?\[[^>]+>)|<!--(?!\[|>)([\s\S]*?)(-->|$)|\bstyle\s*=\s*("(?:[^\\"\r\n\f]|\\[\s\S])+"|'(?:[^\\'\n\r\f]|\\[\s\S])+')/ig;
callback = callback || function(m, $1, $2, $3, $4, $5, $6, $7, $8, $9, $10) {
if ($1) { //<script>
var embed = '';
Expand Down