#1 WordPress forum plugin created by gVectors Team

wpForo – WordPress Forum Plugin
  • Home
  • Forum
  • Migrate to wpForo
  • Addons
  • Addons Demo
  • Documentation

Forum

Home | Forum

wpDiscuz - WordPress Comment Plugin
  • Forums
  • Members
  • Recent Posts
Forums
Main Support Forums
How-to and Troubles...
Q&A schema problem ...
 
Share:
Share
Tweet
Share
Notifications
Clear all

[Solved] Q&A schema problem with LaTex content

    Last Post
RSS

xfok
Posts: 67
 xfok
Beta Tester
Topic starter
June 11, 2021 10:48 am
(@xfok)
Trusted Member
Joined: 3 years ago

First of all thank you for adding the Q&A schema in wpForo, a nice update. However, in some questions an error is recognized. I attach an image to make it clear.

 

 Immagine.png
Topic Tags
latex QA Schema
10 Replies
Robert
Posts: 9090
Robert - Twitter
 Robert
Admin
June 11, 2021 11:03 am
(@robert)
Support Team
Joined: 6 years ago

Hi @xfok,

This is not a bug. I think you have some specific content in the post which has crashed the JS syntax. I'd recommend check other topics, and please report the errors in English. 

In case you want to say thank you !)
We'd really appreciate and be thankful if you leave a good review on plugin page. This is the best way to say thank you to this project and support team.

Reply
5 Replies
xfok
 xfok
Beta Tester
(@xfok)
Joined: 3 years ago

Trusted Member
Posts: 67
June 11, 2021 12:00 pm
Reply toRobertRobert

@robert

Yes, in questions where Latex is used (mathematical writing) it is not recognized. The error reported is the following: Empty escape sequence in string

It is possible to somehow reach this error, being a mathematics site on 6000 questions about 4000 make use of Latex so most of them will not be validated by the Q&A scheme

Reply
Robert
 Robert
Admin
(@robert)
Joined: 6 years ago

Support Team
Posts: 9090
Robert - Twitter
June 11, 2021 12:22 pm
Reply toxfokxfok
Robert

@xfok ,

Ok, then we can filter that, there is a filter hook on the scheme which can help us. Please leave a direct link to that topic, so I can suggest you a fixing hook code.

In case you want to say thank you !)
We'd really appreciate and be thankful if you leave a good review on plugin page. This is the best way to say thank you to this project and support team.

Reply
Robert
 Robert
Admin
(@robert)
Joined: 6 years ago

Support Team
Posts: 9090
Robert - Twitter
June 11, 2021 1:06 pm
Reply toRobertRobert
xfok
Robert

As far as I see we just need to remove the backslashes or escape them with new backslashes from the body of question scheme in this case the JSON parsing will work and there will not be any error on validation. So just leave a URL to that topic, so we could see the syntax issues.  

In case you want to say thank you !)
We'd really appreciate and be thankful if you leave a good review on plugin page. This is the best way to say thank you to this project and support team.

Reply
xfok
 xfok
Beta Tester
(@xfok)
Joined: 3 years ago

Trusted Member
Posts: 67
June 11, 2021 1:16 pm
Reply toRobertRobert
Robert
xfok
Robert

@robert 

https://www.sosmatematica.it/forum/domande/calcolare-il-momento-magnetico-di-una-particella/

Reply
dimalifragis
 dimalifragis
Beta Tester
(@dimalifragis)
Joined: 2 years ago

Noble Member
Posts: 1136
June 11, 2021 1:27 pm
Reply toxfokxfok
Robert
Robert
xfok
Robert

@xfok All i see in the above are errors from peepso-groups

 

Uncaught TypeError: t.group is undefined
    [1]</</<  https://www.sosmatematica.it/wp-content/plugins/peepso-groups/assets/js/page-group.min.js?mt=1622629596&ver=3.4.0.4:1 
    [1]</<  https://www.sosmatematica.it/wp-content/plugins/peepso-groups/assets/js/page-group.min.js?mt=1622629596&ver=3.4.0.4:1 
    [1]<  https://www.sosmatematica.it/wp-content/plugins/peepso-groups/assets/js/page-group.min.js?mt=1622629596&ver=3.4.0.4:1 
    d  https://www.sosmatematica.it/wp-content/plugins/peepso-groups/assets/js/page-group.min.js?mt=1622629596&ver=3.4.0.4:1 
    d  https://www.sosmatematica.it/wp-content/plugins/peepso-groups/assets/js/page-group.min.js?mt=1622629596&ver=3.4.0.4:1 
    [2]</</<  https://www.sosmatematica.it/wp-content/plugins/peepso-groups/assets/js/page-group.min.js?mt=1622629596&ver=3.4.0.4:1 
    [2]</<  https://www.sosmatematica.it/wp-content/plugins/peepso-groups/assets/js/page-group.min.js?mt=1622629596&ver=3.4.0.4:1 
    [2]<  https://www.sosmatematica.it/wp-content/plugins/peepso-groups/assets/js/page-group.min.js?mt=1622629596&ver=3.4.0.4:1 
    d  https://www.sosmatematica.it/wp-content/plugins/peepso-groups/assets/js/page-group.min.js?mt=1622629596&ver=3.4.0.4:1 
    d  https://www.sosmatematica.it/wp-content/plugins/peepso-groups/assets/js/page-group.min.js?mt=1622629596&ver=3.4.0.4:1 
    [4]<  https://www.sosmatematica.it/wp-content/plugins/peepso-groups/assets/js/page-group.min.js?mt=1622629596&ver=3.4.0.4:1 
    d  https://www.sosmatematica.it/wp-content/plugins/peepso-groups/assets/js/page-group.min.js?mt=1622629596&ver=3.4.0.4:1 
    d  https://www.sosmatematica.it/wp-content/plugins/peepso-groups/assets/js/page-group.min.js?mt=1622629596&ver=3.4.0.4:1 
    [5]<  https://www.sosmatematica.it/wp-content/plugins/peepso-groups/assets/js/page-group.min.js?mt=1622629596&ver=3.4.0.4:1 
    d  https://www.sosmatematica.it/wp-content/plugins/peepso-groups/assets/js/page-group.min.js?mt=1622629596&ver=3.4.0.4:1 
    a  https://www.sosmatematica.it/wp-content/plugins/peepso-groups/assets/js/page-group.min.js?mt=1622629596&ver=3.4.0.4:1 
    <anonymous>  https://www.sosmatematica.it/wp-content/plugins/peepso-groups/assets/js/page-group.min.js?mt=1622629596&ver=3.4.0.4:1 
Reply
Robert
Posts: 9090
Robert - Twitter
 Robert
Admin
June 11, 2021 3:39 pm
(@robert)
Support Team
Joined: 6 years ago

All is clear, the Latex raw content has some back-slashes, and they crash the JSON syntax. The content should be filtered. Please let me know which Latex plugin do you use: https://wordpress.org/plugins/tags/latex/

In case you want to say thank you !)
We'd really appreciate and be thankful if you leave a good review on plugin page. This is the best way to say thank you to this project and support team.

Reply
3 Replies
xfok
 xfok
Beta Tester
(@xfok)
Joined: 3 years ago

Trusted Member
Posts: 67
June 11, 2021 10:13 pm
Reply toRobertRobert

@robert simple mathjax https://it.wordpress.org/plugins/simple-mathjax/

Reply
Robert
 Robert
Admin
(@robert)
Joined: 6 years ago

Support Team
Posts: 9090
Robert - Twitter
June 13, 2021 6:31 am
Reply toxfokxfok
Robert

Ok, thank you, @xfok,

This hook code should fix the issue. Please put this code in the functions.php file of your current active WordPress theme, delete all caches and check it again:

add_filter('wpforo_seo_meta_tags', 'wpforo_latext_filter_for_seo_tags');
function wpforo_latext_filter_for_seo_tags( $content ){
$pth = array( '|\$\$|', '|\$(\p{L})|u', '|(\p{L})\$|u', '|\\\text\{([^\}]+)\}|', '|\}\$|', '|\$\\\|', '|\\\pm|', '|\\\times|', '|\\\div|', '|\\\mathrm\{~?(\w{1,3})\}|', '|\\\Rightarrow|', '|\\\Leftarrow|', '|\\\cdot|', '|\\\right\)|', '|\\\left\(|', '|=\$\$=|', '|\\\(\p{L}+)\s?|', '|\\\|' );
$rep = array( ' ', '$1', '$1', ' $1 ', '}', '\\', '+/-', 'x', '/', '$1', '=>', '<=', '.', ')', '(', ' = ', ' $1 ', '' );
$content_fixed = preg_replace($pth, $rep, $content);
if( $content_fixed ) return $content_fixed;
return $content;
}

In case you want to say thank you !)
We'd really appreciate and be thankful if you leave a good review on plugin page. This is the best way to say thank you to this project and support team.

Reply
xfok
 xfok
Beta Tester
(@xfok)
Joined: 3 years ago

Trusted Member
Posts: 67
June 13, 2021 7:25 am
Reply toRobertRobert
xfok
Robert

@robert Thank you so much, fantastic support. The problem seems to be solved! 😊 

Reply
  All forum topics
  Previous Topic
Next Topic  
Topic Tags:  latex (2), QA Schema (2),

Forum Search

Join Us!

Download wpForo plugin
on WordPress.org

wpForo Addons

wpforo-private-messages wpforo-advanced-attachments-128x128 wpforo-embeds-128x128 wpForo User Custom Fields addon wpForo – Blog Cross Posting addon wpForo Ads Manager wpForo – WooCommerce Memberships Integration wpForo Emoticons wpForo – Tenor GIFs Integration
View all Addons »

Recent Topics

  • Attachments not showing on forums posts after migration

    By Formicid, 2 hours ago

  • New Feature About Plugin Customization and Integration

    By z14165899, 13 hours ago

  • WordPress Email sending function wp_mail() doesn't work!

    By feassistant, 21 hours ago

  • Import users from IPBoard

    By jesusdlg, 1 day ago

  • Intruder signing in to wpforo without approval

    By plaurits, 2 days ago

  • How to make new user to get approve manually before creating post and profile.

    By Adhyansh21, 3 days ago

Topic Tags

  • css52
  • translation50
  • plugin conflict48
  • seo47
  • new features45
  • buddypress43
  • avatar41
  • moderation40
  • ultimate member40
  • login40
  • forum40
  • registration37
  • threaded layout35
  • cache34
  • spam33
  • editor33
  • menu33
  • shortcode32
  • forum accesses30
  • widget29
View all tags (2195)

Recent Posts

  • RE: replacing create_function() with something else for PHP8 [duplicate]

    Hi @douglajonson, what is the plugin name?

    By Chris, 26 mins ago

  • RE: Description for each topic?

    @christine, wpForo does not have a topic description ...

    By Chris, 52 mins ago

  • RE: About Plugin Customization and Integration

    Hi @z14165899, Please send your request to sales[at]g...

    By Chris, 1 hour ago

  • Attachments not showing on forums posts after migration

    Hello I just did a manual migration and the older forum...

    By Formicid, 2 hours ago

  • RE: WordPress Email sending function wp_mail() doesn't work!

    @dimalifragis thanks for the enlightenment there. It...

    By feassistant, 15 hours ago

  • RE: Intruder signing in to wpforo without approval

    Maybe at Wordpress.org ?

    By dimalifragis, 23 hours ago

  • Import users from IPBoard

    Hello, Is it possible to import users from ipboard? (...

    By jesusdlg, 1 day ago

Share:
Share
Tweet
Share
  Forum Statistics
21 Forums
9,940 Topics
50.3 K Posts
6 Online
48.4 K Members

Latest Post: replacing create_function() with something else for PHP8 [duplicate] Our newest member: Лестницы Деревянные Цена В Ниж... Recent Posts Unread Posts Tags

Forum Icons: Forum contains no unread posts Forum contains unread posts

Topic Icons: Not Replied Replied Active Hot Sticky Unapproved Solved Private Closed

Powered by wpForo | Copyright © 2016-2022 gVectors Team
Copyright Registration Service - Click here for more information or to register work
wpForo is Registered with the IP Rights Office
Copyright Registration Service

Ref: 4477265538
  • Home
  • Forum
  • Migrate to wpForo
  • Addons
  • Addons Demo
  • Documentation