Instant Articles Errors

Posted in: Newspaper
Post count: 4

Some of my published instant articles were getting unpublished due to the same errors:

General Errors: Unexpected end tag : style
General Errors: Unexpected end tag : style
General Errors: Unexpected end tag : textarea

After searching the produced instant article code, I saw that those errors arise from the js code that is automatically produced from the live css edit feature.

How’s possible to either disable the live css edit feature or edit the code — tell me where the files are located?

Thank you.

PS

The lines that produce the errors are:

1. //jQuery(‘head’).append(‘<style>’ + arr_splits[i] + ‘</style>’);
2. splited_css += “<style>” + formated_str + “</style>”;
3. $liveIframe.contents().find(‘body’).append(‘<textarea class=”tdw-css-writer-editor” style=”display: none”></textarea>’);

Post count: 22421

Hello,

I’m not sure what live css you are referring to. There is no live css on posts in our theme. Are you sure it’t not a plugin you are mentioning?

Post count: 4

The 'Live CSS' feature of the theme

Also you describe that feature in the update ”Version 8.0 – May 24rd, 2017” in Themeforest as: “new: Live frontend LESS and CSS editor. This allows you to quickly add CSS or LESS quick to any page of your site”

Thanks

Post count: 22421

Hi,

The code comes from the tagdiv composer plugin. If you want to rem,ove it simply access the plugin files from wp-content/plugins and comment out or delete this code: https://www.screencast.com/t/6QhBNFhchy7E

Thank you!

Post count: 4

Hello again,

Even though I disabled the Live CSS feature, I still get a validation error from FB. Although the validation errors went down from 3 to 2 — The live css was causing the 3rd error.

Nevertheless, the problematic code is located in 2 lines which are:

1. //jQuery(‘head’).append(‘<style>’ + arr_splits[i] + ‘</style>’);
2. splited_css += “<style>” + formated_str + “</style>”;

Do you have any idea where this code might be located? Here’s the full snippet of the code:

<!-- JS generated by theme -->

<script>
(function() {
var html_jquery_obj = jQuery('html');

if (html_jquery_obj.length && (html_jquery_obj.is('.ie8') || html_jquery_obj.is('.ie9'))) {

var path = 'https://www.magicalrecipesonline.com/wp-content/themes/Newspaper/style.css';

jQuery.get(path, function(data) {

var str_split_separator = '#td_css_split_separator';
var arr_splits = data.split(str_split_separator);
var arr_length = arr_splits.length;

if (arr_length > 1) {

var dir_path = 'https://www.magicalrecipesonline.com/wp-content/themes/Newspaper';
var splited_css = '';

for (var i = 0; i < arr_length; i++) {
if (i > 0) {
arr_splits[i] = str_split_separator + ' ' + arr_splits[i];
}
//jQuery('head').append('<style>' + arr_splits[i] + '</style>');

var formated_str = arr_splits[i].replace(/\surl\(\'(?!data\:)/gi, function regex_function(str) {
return ' url(\'' + dir_path + '/' + str.replace(/url\(\'/gi, '').replace(/^\s+|\s+$/gm, '');
});

splited_css += "<style>" + formated_str + "</style>";
}

var td_theme_css = jQuery('link#td-theme-css');

if (td_theme_css.length) {
td_theme_css.after(splited_css);
}
}
});
}
})();
</script>

Post count: 20688

Hi,

I believe this is the code you are referring to, in this file
https://www.screencast.com/t/RPP8YC7Z

Thanks

Post count: 4

Yes that was the file.

Thank you.

I’ll wait to see how it goes with FB Instant Articles conversion and if ok, I’ll close the ticket.

Thanks again

Viewing 7 posts - 1 through 7 (of 7 total)
The forum ‘Newspaper’ is closed to new topics and replies.