gitea/modules
Giteabot ac65aeecbd
Fixes #27605: inline math blocks can't be preceeded/followed by alphanumerical characters (#30175) (#30251)
Backport #30175 by @jmlt2002

- Inline math blocks couldn't be preceeded or succeeded by
alphanumerical characters due to changes introduced in PR #21171.
Removed the condition that caused this (precedingCharacter condition)
and added a new exit condition of the for-loop that checks if a specific
'$' was escaped using '\' so that the math expression can be rendered as
intended.
- Additionally this PR fixes another bug where math blocks of the type
'$xyz$abc$' where the dollar sign was not escaped by the user, generated
an error (shown in the screenshots below)
- Altered the tests to accomodate for the changes

Former behaviour (from try.gitea.io):

![image](https://github.com/go-gitea/gitea/assets/114936010/8f0cbb21-321d-451c-b871-c67a8e1e9235)

Fixed behaviour (from my local build):

![image](https://github.com/go-gitea/gitea/assets/114936010/5c22687c-6f11-4407-b5e7-c14b838bc20d)

(Edit) Source code for the README.md file:
```
$x$ -$x$ $x$-

a$xa$ $xa$a 1$xb$ $xb$1

$a a$b b$

a$b $a a$b b$

$a a\$b b$
```

Signed-off-by: João Tiago <joao.leal.tintas@tecnico.ulisboa.pt>
Co-authored-by: João Tiago <114936010+jmlt2002@users.noreply.github.com>
2024-04-03 06:17:02 +00:00
..
actions Fix some pending problems (#29985) 2024-03-22 19:17:30 +08:00
activitypub
analyze
assetfs
auth Use `crypto/sha256` (#29386) 2024-02-25 13:32:13 +00:00
avatar Use `crypto/sha256` (#29386) 2024-02-25 13:32:13 +00:00
badge Implement actions badge svgs (#28102) 2024-02-27 18:56:18 +01:00
base Refactor StringsToInt64s (#29967) 2024-03-21 15:07:35 +00:00
cache
charset Render embedded code preview by permlink in markdown (#30234) (#30249) 2024-04-03 02:20:16 +08:00
container
csv Render embedded code preview by permlink in markdown (#30234) (#30249) 2024-04-03 02:20:16 +08:00
dump Refactor "dump" sub-command (#30240) (#30260) 2024-04-03 02:47:06 +00:00
emoji
eventsource
generate
git Include encoding in signature payload (#30174) (#30182) 2024-03-30 00:03:11 +01:00
gitgraph
gitrepo Move get/set default branch from git package to gitrepo package to hide repopath (#29126) 2024-03-08 15:30:10 +08:00
graceful Remove unused error in graceful manager (#29871) 2024-03-18 21:14:51 +00:00
hcaptcha
highlight
hostmatcher
html
httpcache
httplib Refactor external URL detection (#29973) 2024-03-22 04:32:40 +08:00
indexer Render embedded code preview by permlink in markdown (#30234) (#30249) 2024-04-03 02:20:16 +08:00
issue/template Extend issue template yaml engine (#29274) 2024-03-04 01:37:00 +01:00
json
label
lfs Use `crypto/sha256` (#29386) 2024-02-25 13:32:13 +00:00
log
markup Fixes #27605: inline math blocks can't be preceeded/followed by alphanumerical characters (#30175) (#30251) 2024-04-03 06:17:02 +00:00
mcaptcha
metrics
migration
nosql
optional migrate some more "OptionalBool" to "Option[bool]" (#29479) 2024-02-29 18:52:49 +00:00
options
packages Integrate alpine `noarch` packages into other architectures index (#29137) 2024-02-25 15:10:55 +00:00
paginator
pprof
private
process
proxy
proxyprotocol
public
queue Fix queue worker incorrectly stopped when there are still more items in the queue (#29532) 2024-03-02 16:07:54 +00:00
recaptcha
references Fix issue link does not support quotes (#29484) (#29487) 2024-03-02 09:54:46 +00:00
regexplru
repository Add user blocking (#29028) 2024-03-04 08:16:03 +00:00
secret Use `crypto/sha256` (#29386) 2024-02-25 13:32:13 +00:00
session
setting Refactor "dump" sub-command (#30240) (#30260) 2024-04-03 02:47:06 +00:00
sitemap
ssh
storage
structs Fix lint-swagger warning (#29787) 2024-03-14 04:59:52 +00:00
svg Refactor markdown attention render (#29984) 2024-03-22 12:16:23 +00:00
sync
system
templates Render code tags in commit messages (#30146) 2024-03-28 10:42:31 +00:00
test
testlogger
timeutil Refactor "dump" sub-command (#30240) (#30260) 2024-04-03 02:47:06 +00:00
translation Render embedded code preview by permlink in markdown (#30234) (#30249) 2024-04-03 02:20:16 +08:00
turnstile
typesniffer
updatechecker
uri
user
util Refactor "dump" sub-command (#30240) (#30260) 2024-04-03 02:47:06 +00:00
validation
web
webhook