mirror of
1
Fork 0
forgejo/modules
Giteabot 0d3f446460
Fixes #27605: inline math blocks can't be preceeded/followed by alphanumerical characters (#30175) (#30250)
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>
(cherry picked from commit 5123ed31914f704348c0660468a3707011f5a160)
2024-04-03 12:39:25 +02:00
..
actions Set pre-step status to `skipped` if job is skipped (#29489) (#29523) 2024-03-10 18:45:58 +07:00
activitypub
analyze
assetfs
auth [GITEA] Drop sha256-simd in favor of stdlib 2023-11-13 14:06:31 +01:00
avatar [GITEA] Drop sha256-simd in favor of stdlib 2023-11-13 14:06:31 +01:00
base [GITEA] Drop sha256-simd in favor of stdlib 2023-11-13 14:06:31 +01:00
cache
charset Preserve BOM in web editor (#28935) (#28959) 2024-01-31 14:18:26 +01:00
container
context implement fix 2024-03-07 22:43:38 +01:00
contexttest
csv
doctor Fix gitea doctor will remove repo-avatar files when execute command storage-archives (#30094) (#30120) 2024-04-03 12:33:02 +02:00
emoji
eventsource
generate
git Include encoding in signature payload (#30174) (#30181) 2024-04-03 12:36:49 +02:00
gitgraph
graceful Avoid unexpected panic in graceful manager (#29629) (#29630) 2024-03-10 18:45:59 +07:00
hcaptcha
highlight Add option to disable ambiguous unicode characters detection (#28454) (#28499) 2023-12-22 12:07:01 +01:00
hostmatcher
html
httpcache
httplib
indexer Make meilisearch do exact search for issues (#29740 & #29671) (#29846) 2024-03-21 17:09:50 +01:00
issue/template
json
label
lfs [GITEA] Drop sha256-simd in favor of stdlib 2023-11-13 14:06:31 +01:00
log
markup Fixes #27605: inline math blocks can't be preceeded/followed by alphanumerical characters (#30175) (#30250) 2024-04-03 12:39:25 +02:00
mcaptcha
metrics
migration
nosql
options
packages
paginator
pprof
private Use correct `has error` check for internal responses (#28796) (#28798) 2024-01-16 14:40:56 +00:00
process
proxy
proxyprotocol
public Refactor CORS handler (#28587) (#28611) 2024-01-16 14:08:38 +00:00
queue Fix queue worker incorrectly stopped when there are still more items in the queue (#29532) (#29546) 2024-03-10 18:45:59 +07:00
recaptcha
references Fix issue link does not support quotes (#29484) (#29487) (#29536) 2024-03-10 18:45:59 +07:00
regexplru
repository Only log error when tag sync fails (#29295) (#29327) 2024-03-06 12:20:42 +08:00
secret [GITEA] Drop sha256-simd in favor of stdlib 2023-11-13 14:06:31 +01:00
session
setting Fix incorrect cookie path for AppSubURL (#29534) (#29552) 2024-03-10 18:45:59 +07:00
sitemap
ssh [GITEA] Remove SSH workaround 2023-11-13 14:06:31 +01:00
storage
structs [ACTIONS] on.schedule: create a new payload 2023-12-23 15:58:37 +01:00
svg
sync
system
templates Rework markup link rendering (#26745) (#28803) 2024-01-16 14:41:11 +00:00
test
testlogger
timeutil Make template `DateTime` show proper tooltip (#28677) (#28683) 2024-01-16 14:16:55 +00:00
translation
turnstile
typesniffer
updatechecker
upload
uri
user
util [GITEA] rework long-term authentication 2024-01-16 14:14:46 +00:00
validation
web [GITEA] Use maintained gziphandler 2024-01-16 14:09:55 +00:00
webhook [ACTIONS] on.schedule: the event is always "schedule" 2023-12-23 15:58:37 +01:00