-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HTML Comment Blocks #24
Conversation
Co-authored-by: Lara Pfennigschmidt <lara.pfennigschmidt@student.hpi.de> Co-authored-by: Kira Grammel <kira.grammel@student.hpi.de>
-makes it consistent with the BlockTextStyler Co-authored-by: Lara Pfennigschmidt <lara.pfennigschmidt@student.hpi.de>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfect. Works great.
...itor-Tests.package/MarkdownCommentBlockTests.class/instance/testMismatchGTAfterOpeningTag.st
Outdated
Show resolved
Hide resolved
...Tests.package/MarkdownCommentBlockTests.class/instance/testMismatchMinusGTAfterOpeningTag.st
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some class comments are missing e.g. for all MarkdownBlock classes. I don't know if we need class comments for the test classes. 🤔
packages/MarkdownEditor-Core.package/MarkdownCommentBlock.class/class/matches..st
Outdated
Show resolved
Hide resolved
packages/MarkdownEditor-Core.package/MarkdownCommentBlock.class/instance/commentEnd.st
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And yes, we should write class comments ^^
packages/MarkdownEditor-Core.package/MarkdownCommentBlock.class/class/matches..st
Outdated
Show resolved
Hide resolved
packages/MarkdownEditor-Core.package/MarkdownCommentBlock.class/instance/commentEnd.st
Outdated
Show resolved
Hide resolved
packages/MarkdownEditor-Core.package/MarkdownCommentBlock.class/class/matches..st
Outdated
Show resolved
Hide resolved
-removes magic numbers and magic strings
packages/MarkdownEditor-Core.package/MarkdownCommentBlock.class/instance/commentStart.st
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code reads like a charm, the only puzzling moment is - like always - matches
. I hope that my interpretation of the spec is correct, and that you can simplify it.
packages/MarkdownEditor-Core.package/MarkdownCommentBlock.class/instance/asText.st
Outdated
Show resolved
Hide resolved
packages/MarkdownEditor-Core.package/MarkdownParagraph.class/class/matches..st
Outdated
Show resolved
Hide resolved
...nBlockTextStylerTest.class/instance/testBlockStructureCommentBlockNotInterruptedByHeading.st
Show resolved
Hide resolved
...itor-Tests.package/MarkdownCommentBlockTests.class/instance/assertRuns.values.areStyleOf..st
Show resolved
Hide resolved
...or-Tests.package/MarkdownCommentBlockTests.class/instance/testClosingTagInFirstLineCloses.st
Outdated
Show resolved
Hide resolved
|
||
| commentBlock | | ||
commentBlock := MarkdownCommentBlock newFrom: '<!-- MiniMetro', Character cr. | ||
commentBlock append: 'is great --> more Text'. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
commentBlock := MarkdownCommentBlock newFrom: '<!-- Comment with', Character cr.
commentBlock append: 'multiple lines --> Text after end tag'.
Applies to other isClosed
and commentEnd
tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Meh. I think it's pretty clear like it is...
...or-Tests.package/MarkdownCommentBlockTests.class/instance/testCommentStart0To3Indentation.st
Outdated
Show resolved
Hide resolved
tests - matching | ||
testMismatchOverlappingOpeningAndClosingTag | ||
|
||
self deny: (MarkdownCommentBlock matches: '<!-->'). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
after reading the spec, I think that the rules
- Up to 3 indentation
- Begins with
<!--
are sufficient. It differs for inline comments though, where <!-->
and <!--->
and <!-- -- -->
are forbidden.
So I think these tests are wrong and you can remove some lines in matches:
. But maybe I just misread the spec...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm seems like you are right. I think it's confusing that they have different rules abut trying it with https://spec.commonmark.org/dingus/ gives the result you described.
(I changed it already but didn't resolve it to avoid confusion)
-corrects `MarkdonwCommentBlock>>matches:` to comply with spec -improves some coding standards -adds accessort for `openingTag` and `closingTag` on instance side of `MarkdownCommentBlock`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No big suggestions left. But the discussion about the test strings remains...
This is ready and can be reviewed even though the tests in 5.0 are failing as we plan to no longer support 5.0. No reason why you couldn't review it yet though.
Obviously merging will have to wait for the removal of 5.0 support.