Updated <em> tag logic using _#3
Open
FlightControl-User wants to merge 1 commit intompeterv:masterfrom
Open
Conversation
In markdown, an _ is something special ... One cannot just scan for every _ in a text and emphasize every text between _ (underscores). In many program languages, _ are used to represent a space in identifiers and functions etc. Therefore, I've updated the markdown.lua logic to ensure that text between _ is only emphasized when the first _ starts with a space or any other non alpameric character, or the _ starts at the beginning of the text. examples: AI\_CARGO\_DISPATCHER gives AI\_CARGO\_DISPATCHER. AI \_CARGO\_ DISPATCHER gives AI <em>CARGO</em> DISPATCHER. \_AI\_CARGO\_DISPATCHER gives <em>AI</em>CARGO\_DISPATCHER
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
In markdown, an _ is something special ... One cannot just scan for every _ in a text and emphasize every text between _ (underscores). In many program languages, _ are used to represent a space in identifiers and functions etc.
Therefore, I've updated the markdown.lua logic to ensure that text between _ is only emphasized when the first _ starts with a space or any other non alpameric character, or the _ starts at the beginning of the text.
examples:
AI_CARGO_DISPATCHER gives AI_CARGO_DISPATCHER.
AI _CARGO_ DISPATCHER gives AI CARGO DISPATCHER.
_AI_CARGO_DISPATCHER gives AICARGO_DISPATCHER.
but!
AI*CARGO*DISPATCHER would still gives AICARGODISPATCHER !
I think this change makes a lot of sense and I hope this can be incorporated in the main master branch.
The way how I coded this may not be the most efficient, but I am sure that you'll understand why I approached the problem like this.
I have added
tests.svento the test mix to ensure that the above is properly tested.One test case in the original test cases now will give an error, and I think you need to review this. The test case itself is I think a lot of bollocks :-) I think this test case can be safely removed from the set, but it is your decision what to do with it :-)
thanks for your advice and I hope this pull request can be accepted!
Sven (FlightControl) Van de Velde