summaryrefslogtreecommitdiffstats
path: root/modules/markup
Commit message (Collapse)AuthorAgeFilesLines
* Fix reported issue in repo description (#6306)zeripath2019-03-111-0/+48
|
* Replace linkRegex with xurls library (#6261)mrsdizzie2019-03-072-3/+11
| | | | | | | | | | | | | | | | | | | | * Replace linkRegex with xurls library Rather than maintaining a complicated regex to match URLs for autolinking, gitea can use this existing go library that takes care of the matching with very little code change to gitea itself. After spending a while trying to find the perfect regex for all cases this library still works better as it is more flexible than a single regex ever will be. This will also fix the following issues: #5844 #3095 #3381 This passes all our current tests and I've added new ones mentioned in those issues as well. * Use xurls.StrictMatchingScheme instead of xurls.Strict This is much faster and we only care about https? links to preserve existing behavior.
* Remove visitLinksForShortLinks features (#6257)mrsdizzie2019-03-072-14/+9
| | | | | | | | | | | | | | | | | | | | | | The visitLinksForShortLinks feature would look inside of an <a> tag and run shortLinkProcessorFull on any text, which attempts to create links out of potential 'short links' like [[test]] [[link|example]] etc... This makes no sense because you can't have nested links within an <a> tag. Specifically, the html5 standard says <a> tags can't include interactive content if they contain the href attribute: http://w3c.github.io/html/single-page.html#the-a-element And also defines an <a> element with a href attribute as interactive: http://w3c.github.io/html/single-page.html#interactive-content Therefore you can't really put a link inside of another link. In practice none of this works anyways since browsers won't render it, it would probably be broken if they tried, and it is causing a bug (#4946). No current tests rely on this behavior either. This removes the feature and also explicitly excludes the current visitNodeForShortLinks from looking in <a> tags.
* Modify linkRegex to require http|https (#6171)mrsdizzie2019-02-282-1/+63
| | | | | Modify the current linkRegex to require http|https which appears to be the intended behavior based on the comments. Right now, it also matches anything starting with www as well. Also add testing for linkRegex
* Allow markdown files to read from the LFS (#5787)zeripath2019-02-121-1/+1
| | | | | | | This PR makes it possible for the markdown renderer to render images and media straight from the LFS. Fix #5746 Signed-off-by: Andrew Thornton [art27@cantab.net](mailto:art27@cantab.net)
* Recover panic in orgmode.Render if bad orgfile (#4982) (#5903)zeripath2019-01-301-4/+10
| | | | | | | This PR protects against the panic referred to in chaseadmsio/goorgeous#82 by recovering from the panic and just returning the raw bytes if there is an error. Signed-off-by: Andrew Thornton <art27@cantab.net>
* Prioritize "readme.md" (#5691)Khaled Hamed2019-01-142-2/+29
| | | | | | | | * prioritize readme.md * Improve IsReadmeFile * Add more tests
* support envs on external render commands (#5278)Lunny Xiao2018-11-201-5/+17
|
* Fix markdown image with link (#4675)L.E.R2018-10-302-22/+21
| | | | | | | | | | * Fix markdown image with link * Add gitea copyright notice * add a test for markdown image with link * remove svg related variables
* Pass link prefixes to external markup parsers (#5201)Nicolas Lenz2018-10-301-0/+5
| | | | | | | | | | | | | | * Pass environment variables for URL prefixes to external markup parser Signed-off-by: Nicolas Lenz <nicolas@eisfunke.com> * Document external markup link prefix environment variables Signed-off-by: Nicolas Lenz <nicolas@eisfunke.com> * Run format on link prefix changes Signed-off-by: Nicolas Lenz <nicolas@eisfunke.com>
* Upgrade images in .drone.yml to more recent versions (#4819)techknowlogick2018-08-291-4/+4
|
* Add csv file render support defaultly (#4105)Lunny Xiao2018-07-212-0/+83
| | | | | | * add csv file render support defaultly * escaping csv column content
* Replace src with raw to fix image paths (#4377)Jonas Franz2018-07-051-1/+1
| | | Signed-off-by: Jonas Franz <info@jonasfranz.software>
* markup: escape short wiki link (#4091)Antoine GIRARD2018-06-152-0/+29
|
* Fix wiki inter-links with cases and add tests for this case (#3560)Chaz Reid2018-03-052-6/+16
|
* Rework special link parsing in the post-processing of markup (#3354)Morgan Bazalgette2018-02-276-910/+991
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Get rid of autolink * autolink in markdown * Replace email addresses with mailto links * better handling of links * Remove autolink.js from footer * Refactor entire html.go * fix some bugs * Make tests green, move what we can to html_internal_test, various other changes to processor logic * Make markdown tests work again This is just a description to allow me to force push in order to restart the drone build. * Fix failing markdown tests in routers/api/v1/misc * Add license headers, log errors, future-proof <body> * fix formatting
* Populate URL field of API commits (#3546)Ethan Koenig2018-02-205-82/+46
| | | | | | * Populate URL field of API commits * fix orgmode_test
* Allow square brackets in external issue patterns (#3408)Christian Köberl2018-02-032-2/+7
| | | | | | * Allow square brackets in external issue patterns * Added false test cases for checklist elements
* Recognize more characters in crossreferenced repo name (#3413)Lauris BH2018-01-272-1/+4
|
* Fix issue link rendering in commit messages (#2897)Ethan Koenig2017-11-132-26/+98
| | | | | | | | | | * Fix issue link rendering in commit messages * Update page.tmpl * No links for parens * remove comment
* Add external markup render support (#2570)Lunny Xiao2017-11-071-0/+88
| | | | | | | | | | | | | | | | | | | | | | * add external markup render support * bug fixed * refacotr codes and fix wrong error log * fix comments and add check to prevent leaks * add check for config file and improve the example * check file close error * use ioutil.TempFile instead uuid * correct Render -> Parser * improve warning when incorrect markup setting * fix typos
* Add init support of orgmode document type on file view and readme (#2525)Lunny Xiao2017-09-216-2/+614
| | | | | | | | | | | | | | * add init support of orgmode document type on file view and readme * fix imports * fix imports and readmeExist * fix imports order * fix format * remove unnecessary convert
* Restructure markup & markdown to prepare for multiple markup language… (#2411)Lunny Xiao2017-09-166-24/+1140
| | | | | | | | | | * restructure markup & markdown to prepare for multiple markup languages support * adjust some functions between markdown and markup * fix tests * improve the comments
* gofmt (#1710)Ethan Koenig2017-05-121-1/+0
|
* markup: microoptimise for many short filenames in directory (#1534)mappu2017-05-092-2/+6
| | | | | | | | * markup: microoptimise for many short filenames in directory Move strings.ToLower() after the early-return length check. This is a safe operation in all cases and should slightly improve directory listing performance when a directory contains many thousands of files with short filenames. * markup: expand test cases for IsReadmeFile()
* fix multiple readme file rendering and fix #1657 (#1658)Lunny Xiao2017-05-021-0/+9
| | | | | | * fix multiple readme file rendering and fix #1657 * remove unnecessary loop
* Add markup package to prepare for org markup format (#1493)Lunny Xiao2017-04-212-0/+108