mirror of
https://github.com/friendica/friendica
synced 2025-04-19 06:30:10 +00:00
oembed. fix html2bbcode when oembed html contains span and utf8 chars
This commit is contained in:
parent
01164c8c2f
commit
6769436f3b
2 changed files with 26 additions and 15 deletions
|
@ -53,19 +53,24 @@
|
|||
|
||||
/* oembed */
|
||||
function _h2b_cb(match) {
|
||||
text = bin2hex(match);
|
||||
function s_h2b(data) {
|
||||
match = data;
|
||||
}
|
||||
$.ajax({
|
||||
url: 'oembed/h2b?text=' + text,
|
||||
}
|
||||
$.ajax({
|
||||
type:"POST",
|
||||
url: 'oembed/h2b',
|
||||
data: {text: match},
|
||||
async: false,
|
||||
success: s_h2b,
|
||||
dataType: 'html'
|
||||
});
|
||||
return match;
|
||||
}
|
||||
s = s.replace(/<span class=\"oembed(.*?)<\/span>/gi, _h2b_cb);
|
||||
if (s.indexOf('class="oembed')>=0){
|
||||
//alert("request oembed html2bbcode");
|
||||
s = _h2b_cb(s);
|
||||
}
|
||||
|
||||
/* /oembed */
|
||||
|
||||
|
||||
|
@ -154,4 +159,4 @@
|
|||
|
||||
// Register plugin
|
||||
tinymce.PluginManager.add('bbcode', tinymce.plugins.BBCodePlugin);
|
||||
})();
|
||||
})();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue