5 kyu
Basic markdown to HTML
103limeyb7
Loading description...
Strings
Regular Expressions
Algorithms
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
With the current requirements either the input must be
"###### # Maecenas..."
or the expected result must be"< h6>Maecenas...< /h6>"
.From random tests:
Leading
#
s without a space after them are not valid Markdown headers, and should not be considered as a header. Your description and fixed tests expect the extra space to be present too.I think your random test generator has missed a whitespace after them.
Should be fixed now, please check;-)!
Now there's another issue: tests sometimes generates
****
and the test expects< strong>< /strong>
.Bold items with nothing inside is not valid Markdown, so it shouldn't be parsed that way.
Fixed it myself ;-)
I also improved the descriptions.
I've been trying to complete this kata, but I'm having issues with a randomly generated test:
(That last commented out line is what I generated. The test thinks I should be removing extra asterisks after the bolding **. Is that correct?
Hey, thanks for the feedback, I'll check it out and get back to you (ignore my last comment if you saw it, made no sense!)
Ok, I've made some small changes so that it should now be ok (would be really grateful for any more feedbak!)
The changes mean that a series of 4 asterisks will return
< strong>< /strong>
(i.e. empty HTML tags)I checked the behaviour against this markdown previewer
Cool. Seems to be working now. Though I'd make sure there is a specific test for
****
-like inputs. Looks like it still may only be generated randomly.Is there a reason we need to add spaces within the tags? Seems pretty weird...
Yes, there's a reason. In my experience Codewars handles HTML kind of weirdly and the tests don't work as you'd expect, so I added in the extra space in order to escape that. I'll write a note about it in the description of the Kata.