Skip to content

Commit

Permalink
Update compile.js
Browse files Browse the repository at this point in the history
fix fex-team#1266
增加小程序image,cover-image路径解析支持
  • Loading branch information
damoclesX authored Nov 2, 2018
1 parent eadc96b commit 9ecd500
Showing 1 changed file with 3 additions and 3 deletions.
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

0 comments on commit 9ecd500

Please sign in to comment.