forgejo/routers/web
Richard Mahn 40c8451b7d
Properly determine CSV delimiter (#17459)
* Fixes #16558 CSV delimiter determiner

* Fixes #16558 - properly determine CSV delmiiter

* Moves quoteString to a new function

* Adds big test with lots of commas for tab delimited csv

* Adds comments

* Shortens the text of the test

* Removes single quotes from regexp as only double quotes need to be searched

* Fixes spelling

* Fixes check of length as it probalby will only be 1e4, not greater

* Makes sample size a const, properly removes truncated line

* Makes sample size a const, properly removes truncated line

* Fixes comment

* Fixes comment

* tests for FormatError() function

* Adds logic to find the limiter before or after a quoted value

* Simplifies regex

* Error tests

* Error tests

* Update modules/csv/csv.go

Co-authored-by: delvh <dev.lh@web.de>

* Update modules/csv/csv.go

Co-authored-by: delvh <dev.lh@web.de>

* Adds comments

* Update modules/csv/csv.go

Co-authored-by: delvh <dev.lh@web.de>

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: delvh <dev.lh@web.de>
2021-10-30 23:50:40 +08:00
..
admin Refactor update checker to use AppState (#17387) 2021-10-21 17:10:49 +01:00
dev Refactor routers directory (#15800) 2021-06-09 01:33:54 +02:00
events Move login related structs and functions to models/login (#17093) 2021-09-24 19:32:56 +08:00
explore Add user status filter to admin user management page (#16770) 2021-10-12 20:11:35 +02:00
feed Fix mispelling of starred as stared (#17465) 2021-10-28 15:05:00 +08:00
org Move login related structs and functions to models/login (#17093) 2021-09-24 19:32:56 +08:00
repo Properly determine CSV delimiter (#17459) 2021-10-30 23:50:40 +08:00
user Add appearance section in settings (#17433) 2021-10-27 23:40:08 +08:00
base.go Use a variable but a function for IsProd because of a slight performance increment (#17368) 2021-10-20 16:37:19 +02:00
goget.go Related refactors to ctx.FormX functions (#16567) 2021-08-11 18:08:52 +03:00
home.go Refactor routers directory (#15800) 2021-06-09 01:33:54 +02:00
metrics.go Refactor routers directory (#15800) 2021-06-09 01:33:54 +02:00
nodeinfo.go Add nodeinfo endpoint for federation purposes (#16953) 2021-09-28 01:38:06 +02:00
swagger_json.go Refactor routers directory (#15800) 2021-06-09 01:33:54 +02:00
web.go Add appearance section in settings (#17433) 2021-10-27 23:40:08 +08:00