Bug Reply box not available in a thread

  • Thread starter Thread starter Wrichik Basu
  • Start date Start date
AI Thread Summary
Users are experiencing issues with the reply box not appearing in a specific thread, while it works fine in others. The problem persists across multiple browsers, including Chrome, Firefox, and Safari, with some users reporting JavaScript errors. A suggested workaround involves clicking "Reply" on a post to access the edit box with quoted material. The issue appears to be linked to the Prism code highlighting plugin, which fails when double quotation marks are included in user input for line numbers. A proposed solution is to modify the input handling to prevent double quotes from breaking the script execution.
Wrichik Basu
Science Advisor
Insights Author
Gold Member
Messages
2,180
Reaction score
2,717
I am speaking about this thread: https://www.physicsforums.com/threads/recursion-with-a-runnable-in-java.1047991/

This is what I am seeing:

1670582221344.png

Tried from Chrome and Firefox. Same issue. But in other threads, the reply box is working fine.

Does anyone else face the same issue? Mods?
 
Physics news on Phys.org
Me too (Firefox on Android).

Workaround: click Reply in a post and the edit box appears with the quoted material. You can then edit.
 
  • Like
Likes jack action and Wrichik Basu
Ibix said:
Workaround: click Reply in a post and the edit box appears with the quoted material. You can then edit.
Interesting. Once I have replied, I can see the edit box. If I refresh the page, it's gone again.
 
I have the same problem with Safari Version 16.0 (17614.1.25.9.10, 17614)
 
  • Like
Likes Wrichik Basu
Greg Bernhardt said:
What browser and version?
Firefox 108.0 (64-bit) as well as Chrome 108.0.5359.98.
 
Brave, I get a couple of JS errors and no reply box.

Uncaught TypeError: Illegal constructor
at code-block-actions.min.js?_v=93ac117a:2:39
at code-block-actions.min.js?_v=93ac117a:4:313

Uncaught DOMException: Failed to execute 'querySelector' on 'Element': '.line-highlight[data-range=""13"]' is not a valid selector.
at n (https://www.physicsforums.com/js/CM...ugins/line-highlight.min.js?_v=93ac117a:1:487)
at https://www.physicsforums.com/js/CM...gins/line-highlight.min.js?_v=93ac117a:1:2719
at NodeList.forEach (<anonymous>)
at https://www.physicsforums.com/js/CM...gins/line-highlight.min.js?_v=93ac117a:1:2700

Prism plugin is code highlighting? Maybe a crash of that prevented the reply box JS from running.

Minimized code to trigger the problem:
[CODE highlight=""13, 25""]foo[/CODE]
I can reproduce the problem by posting this piece of code in other threads. If I replace the double "" by single " it works, so that's the key problem. I fixed it in the linked thread.
 
Last edited:
  • Like
Likes Wrichik Basu and Ibix
Same issue, same poster in this post. Looks like something about how @Darkmisc is posting code is causing those doubled double quotes.
 
  • Like
Likes mfb and Wrichik Basu
It's coming from the interactive editor:

> Optional. Line numbers you want to highlight. For example, "2, 4-6" will highlight lines 2, 4, 5 and 6.

It wants the user to write e.g. 2,4-6, so it adds quotation marks around the user input. If the user plugs in "2, 4-6" with quotation marks then the post ends up with double quotation marks, which then breaks the execution of the highlighting script. That means the best fix will have two elements:
- check if the user input has quotes already, and remove them before processing the string further to create valid syntax
- catch the invalid input when showing the comment so it doesn't break things

In the meantime: @Darkmisc please don't add " " around the lines you want to highlight.
 
  • Like
  • Informative
Likes Greg Bernhardt, berkeman, Wrichik Basu and 1 other person
  • #10
There is small update to the core software. I'll find a time in the next week to run it.
 
  • Like
Likes mfb and Wrichik Basu

Similar threads

Replies
2
Views
1K
Replies
13
Views
3K
Replies
2
Views
840
Replies
46
Views
10K
Replies
12
Views
2K
Replies
1
Views
3K
Back
Top