
When an include is not surrounded by empty lines, its content is inlined on the same line as the adjacent content. That can lead to broken tags and other display issues. This PR fixes all such includes and introduces a validation step that forbids introducing the same problem again.
34 lines
1.0 KiB
Plaintext
34 lines
1.0 KiB
Plaintext
include::../why-dotnet.adoc[]
|
|
|
|
== How to fix it
|
|
|
|
=== Code examples
|
|
|
|
==== Noncompliant code example
|
|
|
|
[source,vbnet,diff-id=1,diff-type=noncompliant]
|
|
----
|
|
Sub Regexes(Input As String)
|
|
Dim Rx As New Regex("[A") ' Noncompliant: unmatched "["
|
|
Dim Match = Regex.Match(Input, "[A") ' Noncompliant
|
|
Dim NegativeLookahead As New Regex("a(?!b)", RegexOptions.NonBacktracking) ' Noncompliant: negative lookahead without backtracking
|
|
Dim NegativeLookbehind As New Regex("(?<!a)b", RegexOptions.NonBacktracking) ' Noncompliant: negative lookbehind without backtracking
|
|
End Sub
|
|
----
|
|
|
|
==== Compliant solution
|
|
|
|
[source,vbnet,diff-id=1,diff-type=compliant]
|
|
----
|
|
Sub Regexes(Input As String)
|
|
Dim Rx As New Regex("[A-Z]")
|
|
Dim Match = Regex.Match(Input, "[A-Z]")
|
|
Dim NegativeLookahead As New Regex("a(?!b)")
|
|
Dim NegativeLookbehind As New Regex("(?<!a)b")
|
|
End Sub
|
|
----
|
|
|
|
include::../resources-dotnet.adoc[]
|
|
|
|
include::../rspecator.adoc[]
|