0
0
Fork 0
mirror of https://github.com/go-gitea/gitea synced 2024-11-15 06:21:23 +01:00
gitea/modules/markup
Henrique Pimentel f7125ab61a
Add MAX_ROWS option for CSV rendering (#30268)
This solution implements a new config variable MAX_ROWS, which
corresponds to the “Maximum allowed rows to render CSV files. (0 for no
limit)” and rewrites the Render function for CSV files in markup module.
Now the render function only reads the file once, having MAX_FILE_SIZE+1
as a reader limit and MAX_ROWS as a row limit. When the file is larger
than MAX_FILE_SIZE or has more rows than MAX_ROWS, it only renders until
the limit, and displays a user-friendly warning informing that the
rendered data is not complete, in the user's language.

---

Previously, when a CSV file was larger than the limit, the render
function lost its function to render the code. There were also multiple
reads to the file, in order to determine its size and render or
pre-render.

The warning: ![image](https://s3.amazonaws.com/i.snag.gy/vcKh90.jpg)
2024-06-06 16:06:59 +08:00
..
asciicast Support asciicast files as new markup (#22448) 2023-01-18 08:46:58 +08:00
common Make user-content-* consistent with github (#26388) 2023-08-09 09:30:31 +00:00
console Add context when rendering labels or emojis (#23281) 2023-03-05 22:59:05 +01:00
csv Add MAX_ROWS option for CSV rendering (#30268) 2024-06-06 16:06:59 +08:00
external Rework markup link rendering (#26745) 2024-01-15 08:49:24 +00:00
markdown Make blockquote attention recognize more syntaxes (#31240) 2024-06-04 15:35:29 +00:00
mdstripper Resolve lint for unused parameter and unnecessary type arguments (#30750) 2024-04-29 08:47:56 +00:00
orgmode fix: rendering internal file links in org (#29669) 2024-03-10 18:30:14 +02:00
camo.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
camo_test.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
html.go Make pasted "img" tag has the same behavior as markdown image (#31235) 2024-06-04 12:19:41 +00:00
html_codepreview.go Refactor AppURL usage (#30885) 2024-05-07 08:26:13 +00:00
html_codepreview_test.go Render embedded code preview by permlink in markdown (#30234) 2024-04-02 17:48:27 +00:00
html_internal_test.go Make pasted "img" tag has the same behavior as markdown image (#31235) 2024-06-04 12:19:41 +00:00
html_test.go Make pasted "img" tag has the same behavior as markdown image (#31235) 2024-06-04 12:19:41 +00:00
main_test.go Use repo as of renderctx's member rather than a repoPath on metas (#29222) 2024-05-30 07:04:01 +00:00
renderer.go Make pasted "img" tag has the same behavior as markdown image (#31235) 2024-06-04 12:19:41 +00:00
renderer_test.go Move IsReadmeFile* from modules/markup/ to modules/util (#22877) 2023-02-13 15:01:09 -05:00
sanitizer.go Split sanitizer functions and fine-tune some tests (#31192) 2024-05-31 13:26:01 +00:00
sanitizer_custom.go Split sanitizer functions and fine-tune some tests (#31192) 2024-05-31 13:26:01 +00:00
sanitizer_default.go Split sanitizer functions and fine-tune some tests (#31192) 2024-05-31 13:26:01 +00:00
sanitizer_default_test.go Split sanitizer functions and fine-tune some tests (#31192) 2024-05-31 13:26:01 +00:00
sanitizer_description.go Split sanitizer functions and fine-tune some tests (#31192) 2024-05-31 13:26:01 +00:00
sanitizer_description_test.go Split sanitizer functions and fine-tune some tests (#31192) 2024-05-31 13:26:01 +00:00