-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Add MAX_ROWS
option for CSV rendering
#30268
Merged
Merged
Commits on May 26, 2024
-
Fix CSV rendering (go-gitea#29663)
Fixes go-gitea#29663 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. 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. The warning: ![image](https://s3.amazonaws.com/i.snag.gy/ieROGx.jpg)
Configuration menu - View commit details
-
Copy full SHA for 2c57283 - Browse repository at this point
Copy the full SHA 2c57283View commit details -
Configuration menu - View commit details
-
Copy full SHA for 96c5e3c - Browse repository at this point
Copy the full SHA 96c5e3cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 1196da3 - Browse repository at this point
Copy the full SHA 1196da3View commit details -
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 0c2f777 - Browse repository at this point
Copy the full SHA 0c2f777View commit details -
Configuration menu - View commit details
-
Copy full SHA for 271c274 - Browse repository at this point
Copy the full SHA 271c274View commit details -
- Removed tags from sanitizer rules; - The warning message now is a table (to reuse UI elements); - ctx.RelativePath escaped; - Implemented a panic catch when getting a translation error;
Configuration menu - View commit details
-
Copy full SHA for 0656f41 - Browse repository at this point
Copy the full SHA 0656f41View commit details -
Configuration menu - View commit details
-
Copy full SHA for f095a38 - Browse repository at this point
Copy the full SHA f095a38View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0831da7 - Browse repository at this point
Copy the full SHA 0831da7View commit details -
Configuration menu - View commit details
-
Copy full SHA for ec0688b - Browse repository at this point
Copy the full SHA ec0688bView commit details
Commits on Jun 6, 2024
-
Configuration menu - View commit details
-
Copy full SHA for e200869 - Browse repository at this point
Copy the full SHA e200869View commit details -
Configuration menu - View commit details
-
Copy full SHA for aef77ce - Browse repository at this point
Copy the full SHA aef77ceView commit details -
Configuration menu - View commit details
-
Copy full SHA for d5a3c93 - Browse repository at this point
Copy the full SHA d5a3c93View commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.