telerik/docs-seed

Make slugs active in tip-, note-, important-, and caution-flagged notice fields

Closed this issue · 3 comments

When we have a note that is flagged as >tip, >note, >important, or >caution, slugs (both with and w/o an opening and closing space) are not working.

For example, in the >tip note at the end of this section: https://docs.telerik.com/aspnet-core/getting-started/first-steps#initializing-a-grid-and-binding-data.

The content in question has the following syntax:

>tip For more information on data processing and data binding, see the following articles:
>* [Binding the Grid to a database]({% slug htmlhelpers_grid_aspnetcore_ajaxbinding %})
>* [CRUD operations](https://demos.telerik.com/aspnet-core/grid/editing)

Please review this issue to allow more unlimited syntax usage that will help docs creators to stay focused on the content and not on the way for introducing it depending on the cases.

If not too much hassle, fix for >caption too

The related PR #232 improves the regex that captures the slug to check for 0 or more occurrences of the %20 string between the % and slug keyword as well as between the actual slug and the ending % sign. The %20 is actually a string, due to the logic of the plugin that converts manually the markdown to HTML, hence the whitespace becomes %20

Updated test cases: https://rubular.com/r/iHWvuRumrtLtRy

Description of the fix: (?:%20){0,} - create a non-capturing group of the string %20 and check if it is encountered 0 or more times

@dimodi The caption is generated from another plugin that seems to not have any logic for fixing the slugs, so I opened a separate issue for it - #233