-
-
Notifications
You must be signed in to change notification settings - Fork 89
Adding Tex Inline support for the issue #386 #397
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
Adding Tex Inline support for the issue #386 #397
Conversation
application/src/main/java/org/togetherjava/tjbot/commands/mathcommands/TeXCommand.java
Outdated
Show resolved
Hide resolved
application/src/main/java/org/togetherjava/tjbot/commands/mathcommands/TeXCommand.java
Outdated
Show resolved
Hide resolved
application/src/main/java/org/togetherjava/tjbot/commands/mathcommands/TeXCommand.java
Outdated
Show resolved
Hide resolved
application/src/main/java/org/togetherjava/tjbot/commands/mathcommands/TeXCommand.java
Outdated
Show resolved
Hide resolved
application/src/main/java/org/togetherjava/tjbot/commands/mathcommands/TeXCommand.java
Outdated
Show resolved
Hide resolved
application/src/main/java/org/togetherjava/tjbot/commands/mathcommands/TeXCommand.java
Outdated
Show resolved
Hide resolved
application/src/main/java/org/togetherjava/tjbot/commands/mathcommands/TeXCommand.java
Outdated
Show resolved
Hide resolved
application/src/main/java/org/togetherjava/tjbot/commands/mathcommands/TeXCommand.java
Outdated
Show resolved
Hide resolved
application/src/main/java/org/togetherjava/tjbot/commands/mathcommands/TeXCommand.java
Outdated
Show resolved
Hide resolved
application/src/main/java/org/togetherjava/tjbot/commands/mathcommands/TeXCommand.java
Outdated
Show resolved
Hide resolved
application/src/main/java/org/togetherjava/tjbot/commands/mathcommands/TeXCommand.java
Outdated
Show resolved
Hide resolved
application/src/main/java/org/togetherjava/tjbot/commands/mathcommands/TeXCommand.java
Outdated
Show resolved
Hide resolved
application/src/main/java/org/togetherjava/tjbot/commands/mathcommands/TeXCommand.java
Outdated
Show resolved
Hide resolved
application/src/main/java/org/togetherjava/tjbot/commands/mathcommands/TeXCommand.java
Outdated
Show resolved
Hide resolved
application/src/main/java/org/togetherjava/tjbot/commands/mathcommands/TeXCommand.java
Outdated
Show resolved
Hide resolved
application/src/main/java/org/togetherjava/tjbot/commands/mathcommands/TeXCommand.java
Outdated
Show resolved
Hide resolved
application/src/main/java/org/togetherjava/tjbot/commands/mathcommands/TeXCommand.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should also check if you can adjust the description of the command so that users know that they can now also use inline-latex.
application/src/main/java/org/togetherjava/tjbot/commands/mathcommands/TeXCommand.java
Outdated
Show resolved
Hide resolved
application/src/main/java/org/togetherjava/tjbot/commands/mathcommands/TeXCommand.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well done 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
subjective, so just think about it
application/src/main/java/org/togetherjava/tjbot/commands/mathcommands/TeXCommand.java
Outdated
Show resolved
Hide resolved
application/src/main/java/org/togetherjava/tjbot/commands/mathcommands/TeXCommand.java
Outdated
Show resolved
Hide resolved
application/src/main/java/org/togetherjava/tjbot/commands/mathcommands/TeXCommand.java
Outdated
Show resolved
Hide resolved
application/src/main/java/org/togetherjava/tjbot/commands/mathcommands/TeXCommand.java
Outdated
Show resolved
Hide resolved
application/src/main/java/org/togetherjava/tjbot/commands/mathcommands/TeXCommand.java
Outdated
Show resolved
Hide resolved
application/src/main/java/org/togetherjava/tjbot/commands/mathcommands/TeXCommand.java
Outdated
Show resolved
Hide resolved
application/src/main/java/org/togetherjava/tjbot/commands/mathcommands/TeXCommand.java
Outdated
Show resolved
Hide resolved
application/src/main/java/org/togetherjava/tjbot/commands/mathcommands/TeXCommand.java
Outdated
Show resolved
Hide resolved
application/src/main/java/org/togetherjava/tjbot/commands/mathcommands/TeXCommand.java
Outdated
Show resolved
Hide resolved
f7d5ca9
to
7d031ca
Compare
4d6da42
to
90b7b94
Compare
} | ||
|
||
private boolean isInvalidInlineFormat(String latex) { | ||
return latex.chars().filter(ch -> ch == '$').count() % 2 == 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here.
We should escape the possible escaped \$
characters
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We discussed this and agreed that we can ignore it for now.
So unless you have a cheap and easy suggestion to adjust the code to support it, we can also go without it for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry about that.
Didn't know it was discussed.
But, wouldn't (?<!\\)\$
be a good regex for it? It would only match unescaped dollar signs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't know it was discussed.
No worries, not your fault. It was probably in Discord and not here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But, wouldn't (?<!\)$ be a good regex for it? It would only match unescaped dollar signs
Good idea. Does Javas regex engine support that? @IslamSakrak could you try that out?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could also add a really simple unit test to test it too.
Yes, totally correct. We still have a separate GH issue open for adding tests to /tex
, so I didnt want to bloat up this PR with more tasks than necessary (poor @IslamSakrak )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually think that, as soon as this is merged, someone should tackle the unit tests for /tex
. It would benefit a lot from it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're correct.
I'm gonna mention this point on that issue, so it doesn't fall into the forgotten realm when those tests get addressed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wouldn't mind testing this also, I have written some tests already. Also, first time writing tests so might help me get better at it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you want, feel free to either create a second PR or also do it directly in this, thanks. (Assign yourself to the GH issue then though)
application/src/main/java/org/togetherjava/tjbot/commands/mathcommands/TeXCommand.java
Show resolved
Hide resolved
application/src/main/java/org/togetherjava/tjbot/commands/mathcommands/TeXCommand.java
Show resolved
Hide resolved
90b7b94
to
8cf0a9c
Compare
61 conversations personal best 😭 |
This pull request is stale because it has been open 30 days with no activity. Remove stale label, comment or add the valid label or this will be closed in 5 days. |
rip. @IslamSakrak |
How it looks like

The inputs
A$B$C
$Hello$, look at this $\frac{x}{2}$, nice stuff!
The Outputs
\text{A}B\text{C}
Hello\text{, look at this }\frac{x}{2}\text{, nice stuff!}