Skip to content

Commit 196321c

Browse files
committed
hotfix
1 parent ef81b44 commit 196321c

File tree

5 files changed

+20
-26
lines changed

5 files changed

+20
-26
lines changed

dist/js/main.js

+4-6
Original file line numberDiff line numberDiff line change
@@ -2789,15 +2789,15 @@ define("../cardkit/parser/box", [
27892789
: getHd(source && source.find('.ckd-hd-link')),
27902790
hd_opt = getItemDataOuter(source && source.find('.ckd-hdopt'), 'hdopt'),
27912791
ft = getHd(source && source.find('.ckd-ft')),
2792-
contents = getItemDataOuter(source && source.find('.ckd-content'), 'content'),
2792+
contents = source && util.getOuterHTML(source.find('.ckd-content')),
27932793
custom_hd = getCustom('.ckd-hd', unit, raw, take_hd)[0] || {},
27942794
custom_hd_link_extern = getCustom('.ckd-hd-link-extern', unit, raw, take_hd)[0] || {},
27952795
custom_hd_link = custom_hd_link_extern.href
27962796
? custom_hd_link_extern
27972797
: (getCustom('.ckd-hd-link', unit, raw, take_hd)[0] || {}),
27982798
custom_hd_opt = getCustom('.ckd-hdopt', unit, raw, take_item_outer, 'hdopt').join(''),
27992799
custom_ft = getCustom('.ckd-ft', unit, raw, take_hd)[0] || {};
2800-
getCustom('.ckd-content', unit, raw, replace_content, 'content');
2800+
getCustom('.ckd-content', unit, raw, replace_content);
28012801
var data = {
28022802
config: config,
28032803
style: unit.data('style'),
@@ -2818,15 +2818,13 @@ define("../cardkit/parser/box", [
28182818
return data;
28192819
}
28202820

2821-
function replace_content(source, custom, ckdname){
2821+
function replace_content(source, custom){
28222822
if (custom) {
2823-
util.replaceOuterHTML($(custom), source, ckdname);
2823+
$(custom).replaceWith(source.clone());
28242824
} else {
28252825
source = $(source);
28262826
if (!/\S/.test(source.html() || '')) {
28272827
source.remove();
2828-
} else {
2829-
util.replaceOuterHTML(source, source, ckdname);
28302828
}
28312829
}
28322830
}

dist/js/main.min.js

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/dist/js/main.js

+4-6
Original file line numberDiff line numberDiff line change
@@ -2789,15 +2789,15 @@ define("../cardkit/parser/box", [
27892789
: getHd(source && source.find('.ckd-hd-link')),
27902790
hd_opt = getItemDataOuter(source && source.find('.ckd-hdopt'), 'hdopt'),
27912791
ft = getHd(source && source.find('.ckd-ft')),
2792-
contents = getItemDataOuter(source && source.find('.ckd-content'), 'content'),
2792+
contents = source && util.getOuterHTML(source.find('.ckd-content')),
27932793
custom_hd = getCustom('.ckd-hd', unit, raw, take_hd)[0] || {},
27942794
custom_hd_link_extern = getCustom('.ckd-hd-link-extern', unit, raw, take_hd)[0] || {},
27952795
custom_hd_link = custom_hd_link_extern.href
27962796
? custom_hd_link_extern
27972797
: (getCustom('.ckd-hd-link', unit, raw, take_hd)[0] || {}),
27982798
custom_hd_opt = getCustom('.ckd-hdopt', unit, raw, take_item_outer, 'hdopt').join(''),
27992799
custom_ft = getCustom('.ckd-ft', unit, raw, take_hd)[0] || {};
2800-
getCustom('.ckd-content', unit, raw, replace_content, 'content');
2800+
getCustom('.ckd-content', unit, raw, replace_content);
28012801
var data = {
28022802
config: config,
28032803
style: unit.data('style'),
@@ -2818,15 +2818,13 @@ define("../cardkit/parser/box", [
28182818
return data;
28192819
}
28202820

2821-
function replace_content(source, custom, ckdname){
2821+
function replace_content(source, custom){
28222822
if (custom) {
2823-
util.replaceOuterHTML($(custom), source, ckdname);
2823+
$(custom).replaceWith(source.clone());
28242824
} else {
28252825
source = $(source);
28262826
if (!/\S/.test(source.html() || '')) {
28272827
source.remove();
2828-
} else {
2829-
util.replaceOuterHTML(source, source, ckdname);
28302828
}
28312829
}
28322830
}

examples/dist/js/main.min.js

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/cardkit/parser/box.js

+4-6
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@ define([
2525
: getHd(source && source.find('.ckd-hd-link')),
2626
hd_opt = getItemDataOuter(source && source.find('.ckd-hdopt'), 'hdopt'),
2727
ft = getHd(source && source.find('.ckd-ft')),
28-
contents = getItemDataOuter(source && source.find('.ckd-content'), 'content'),
28+
contents = source && util.getOuterHTML(source.find('.ckd-content')),
2929
custom_hd = getCustom('.ckd-hd', unit, raw, take_hd)[0] || {},
3030
custom_hd_link_extern = getCustom('.ckd-hd-link-extern', unit, raw, take_hd)[0] || {},
3131
custom_hd_link = custom_hd_link_extern.href
3232
? custom_hd_link_extern
3333
: (getCustom('.ckd-hd-link', unit, raw, take_hd)[0] || {}),
3434
custom_hd_opt = getCustom('.ckd-hdopt', unit, raw, take_item_outer, 'hdopt').join(''),
3535
custom_ft = getCustom('.ckd-ft', unit, raw, take_hd)[0] || {};
36-
getCustom('.ckd-content', unit, raw, replace_content, 'content');
36+
getCustom('.ckd-content', unit, raw, replace_content);
3737
var data = {
3838
config: config,
3939
style: unit.data('style'),
@@ -54,15 +54,13 @@ define([
5454
return data;
5555
}
5656

57-
function replace_content(source, custom, ckdname){
57+
function replace_content(source, custom){
5858
if (custom) {
59-
util.replaceOuterHTML($(custom), source, ckdname);
59+
$(custom).replaceWith(source.clone());
6060
} else {
6161
source = $(source);
6262
if (!/\S/.test(source.html() || '')) {
6363
source.remove();
64-
} else {
65-
util.replaceOuterHTML(source, source, ckdname);
6664
}
6765
}
6866
}

0 commit comments

Comments
 (0)