Skip to content

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

Closed

Conversation

DevSerendipity
Copy link
Contributor

How it looks like
image

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!}

@DevSerendipity DevSerendipity requested review from a team as code owners February 23, 2022 09:43
Copy link
Member

@Zabuzard Zabuzard left a 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.

Zabuzard
Zabuzard previously approved these changes Feb 24, 2022
Copy link
Member

@Zabuzard Zabuzard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done 👍

@DevSerendipity DevSerendipity marked this pull request as draft February 24, 2022 19:11
Copy link
Member

@Tais993 Tais993 left a 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

@DevSerendipity DevSerendipity marked this pull request as ready for review February 25, 2022 07:08
@Zabuzard Zabuzard linked an issue Feb 25, 2022 that may be closed by this pull request
@Zabuzard Zabuzard added enhance command Modify or improve an existing command or group of commands of the bot priority: normal labels Feb 25, 2022
@Zabuzard Zabuzard added this to the Improvement phase 1 milestone Feb 25, 2022
Tais993
Tais993 previously approved these changes Feb 25, 2022
Zabuzard
Zabuzard previously approved these changes Feb 28, 2022
}

private boolean isInvalidInlineFormat(String latex) {
return latex.chars().filter(ch -> ch == '$').count() % 2 == 1;
Copy link
Contributor

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

Copy link
Member

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.

Copy link
Contributor

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

Copy link
Member

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.

Copy link
Member

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?

Copy link
Member

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 )

Copy link
Member

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.

Copy link
Contributor

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

Copy link
Contributor Author

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

Copy link
Member

@Zabuzard Zabuzard Feb 28, 2022

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)

@DevSerendipity
Copy link
Contributor Author

61 conversations personal best 😭

@github-actions
Copy link

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.

@github-actions github-actions bot added stale inactivity-closed Issues that have been closed due to inactivity, but are otherwise valid and might be reopened later labels Mar 31, 2022
@github-actions github-actions bot closed this Apr 6, 2022
@Zabuzard
Copy link
Member

Zabuzard commented Apr 6, 2022

rip. @IslamSakrak

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhance command Modify or improve an existing command or group of commands of the bot inactivity-closed Issues that have been closed due to inactivity, but are otherwise valid and might be reopened later priority: normal stale
Projects
None yet
Development

Successfully merging this pull request may close these issues.

/tex should support inline TeX
4 participants