SSWConsulting / SSW.CodeAuditor

SSW Code Auditor V2
6 stars 6 forks source link

✨ Custom rule - greyboxes/email templates need line breaks before ":::" #854

Closed tiagov8 closed 4 months ago

tiagov8 commented 6 months ago

Cc: @bradystroud @adamcogan

Hi @tombui99

Pain

We have custom "classes" if you will in our Rules Markdown. For example, to add a greybox:

::: greybox
{{ TEXT }}
:::

❌ That won't work if you have a sentence right before it without a line break. E.g.

Some sentence.
::: greybox
{{ TEXT }}
:::

✅ The fix it, the line break must exist. E.g.

Some sentence.

::: greybox
{{ TEXT }}
:::

See an example of a broken rule that I fixed with Adam: https://github.com/SSWConsulting/SSW.Rules.Content/pull/8099

Suggested Solution

Note: I think CodeAuditor only reads HTML as the browser, but we want to know if the above is possible.


Screenshot 2024-03-08 at 1 09 59 PM

Figure: The broken greybox we found

tombui99 commented 6 months ago

cc @adamcogan @william-liebenberg

Hey @tiagov8

As per our conversation, we are working on a Markdown Auditor that will make this possible by checking all markdown files in a PR.

See https://github.com/SSWConsulting/SSW.CodeAuditor/issues/855

We will make sure we have this implemented on the new "Auditor" when it's ready.