You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
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)
8 months ago
..
asciicast Support asciicast files as new markup (#22448) 2 years ago
common Make `user-content-* ` consistent with github (#26388) 2 years ago
console Add context when rendering labels or emojis (#23281) 2 years ago
csv Add `MAX_ROWS` option for CSV rendering (#30268) 8 months ago
external Rework markup link rendering (#26745) 1 year ago
markdown Make blockquote attention recognize more syntaxes (#31240) 8 months ago
mdstripper Resolve lint for unused parameter and unnecessary type arguments (#30750) 10 months ago
orgmode fix: rendering internal file links in org (#29669) 11 months ago
camo.go Implement FSFE REUSE for golang files (#21840) 2 years ago
camo_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
html.go Make pasted "img" tag has the same behavior as markdown image (#31235) 8 months ago
html_codepreview.go Refactor AppURL usage (#30885) 9 months ago
html_codepreview_test.go Render embedded code preview by permlink in markdown (#30234) 11 months ago
html_internal_test.go Make pasted "img" tag has the same behavior as markdown image (#31235) 8 months ago
html_test.go Make pasted "img" tag has the same behavior as markdown image (#31235) 8 months ago
main_test.go Use repo as of renderctx's member rather than a repoPath on metas (#29222) 9 months ago
renderer.go Make pasted "img" tag has the same behavior as markdown image (#31235) 8 months ago
renderer_test.go Move `IsReadmeFile*` from `modules/markup/` to `modules/util` (#22877) 2 years ago
sanitizer.go Split sanitizer functions and fine-tune some tests (#31192) 9 months ago
sanitizer_custom.go Split sanitizer functions and fine-tune some tests (#31192) 9 months ago
sanitizer_default.go Split sanitizer functions and fine-tune some tests (#31192) 9 months ago
sanitizer_default_test.go Split sanitizer functions and fine-tune some tests (#31192) 9 months ago
sanitizer_description.go Split sanitizer functions and fine-tune some tests (#31192) 9 months ago
sanitizer_description_test.go Split sanitizer functions and fine-tune some tests (#31192) 9 months ago