New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TUI fixes #3483
Conversation
Great PR! Please pay attention to the following items before merging: Files matching
This is an automatically generated QA checklist based on modified files. |
Problem: I need a Windows install package with TUI tomorrow evening. What was the incantation? |
Problem 2: The Regular expressions to remove the HTML decoration in StelObject::postProcessInfoString() is still not good, and it shows in the result. What to update, and where else does it appear (will something else break instead?) |
|
What shows in the result? What is the input? |
If you run this, A date should be visible to the visitors. That works. But the object info shows HTML extras. ( Ah -- you also need to activate F2/Extras/Use formatting. |
Well, the only tag I see slipping through is |
The table with a style can be removed with the following change (and I don't know what diff --git a/src/core/StelObject.cpp b/src/core/StelObject.cpp
index a1008d44e8..6fb81e9cc3 100644
--- a/src/core/StelObject.cpp
+++ b/src/core/StelObject.cpp
@@ -961,6 +961,8 @@ void StelObject::postProcessInfoString(QString& str, const InfoStringGroup& flag
static const QRegularExpression brRe2("<br(\\s*/)?>\\s*");
static const QRegularExpression tdRe("<td(\\w*)?>");
static const QRegularExpression tableRe2("<table(\\w*)?>");
+ static const QRegularExpression tableRe3("<table style='[^']*'>");
+ static const QRegularExpression tableRe4("<table style=\"[^\"]*\">");
str.replace(tableRe, "<table");
// chomp trailing line breaks
str.replace(brRe, "");
@@ -977,6 +979,8 @@ void StelObject::postProcessInfoString(QString& str, const InfoStringGroup& flag
str.replace("<td>", "");
str.replace("</tr>", "\n");
str.replace(tableRe2, "");
+ str.replace(tableRe3, "");
+ str.replace(tableRe4, "");
str.replace("</table>", "");
}
else if(!(flags&NoFont)) |
Yes, same conclusion here. The "\w" is "word characters", right? Maybe spaces and quote signs should be added. I tried |
Right, because the style also contains hyphens, semicolons etc. It's just easier to handle it as "an opening quote, anything that's not a closing quote, a closing quote", for two variants of the quotes. You can put it into a single regex by using alternation. |
Yes, that works great! Thanks a lot! |
Another one: Is this not covered by tdRe? And probably also here any style element like align should be removed. |
Yes, it is. But again, what valid HTML tag does this regex represent aside from |
|
Ah yes, this could also match |
Well, this is the only kind of thing that this regex could match. There's a space missing between the words and the tag name. If you do use explicit style-matching regexes as you do in the new commit, this regex is just useless. |
I replaced the indeed useless |
Now it makes sense. But the |
Right, it's only one element. |
- try to get rid of the formatting in TUI
Thanks to @10110111 for help.
Hello @gzotti! Please check the fresh version (development snapshot) of Stellarium: |
Hello @gzotti! Please check the latest stable version of Stellarium: |
Description
After my surprise about #3481 I decided to push this branch a few days earlier than anticipated.
This is not a complete fix/rethinking of the TUI plugin, just a few updates.
Keyboard action toggles for
Still missing is any type of config GUI, at least with those two flag toggles.
Fixes # (issue)
Screenshots (if appropriate):
Type of change
How Has This Been Tested?
Test Configuration:
Checklist: