github.com/googleapis/api-linter@v1.65.2/docs/rules/0192/no-html.md (about) 1 --- 2 rule: 3 aip: 192 4 name: [core, '0192', no-html] 5 summary: Comments must not use raw HTML 6 permalink: /192/no-html 7 redirect_from: 8 - /0192/no-html 9 --- 10 11 # No HTML in comments 12 13 This rule enforces that every descriptor in every proto file does not use raw 14 HTML in comments, as mandated in [AIP-192][]. 15 16 ## Details 17 18 This rule looks at each descriptor in each proto file (exempting oneofs and the 19 file itself) and tries to find HTML tags, and complains if it finds any. 20 21 **Note:** This lint rule uses a regular expression to look for HTML, which is a 22 [famous anti-pattern][]. We do it anyway to avoid taking a large dependency for 23 one rule. Therefore, this rule allows many false negatives to avoid any false 24 positives; that is, it will intentionally let more complex HTML through in 25 order to prevent cases where it complains and is wrong. 26 27 ## Examples 28 29 **Incorrect** code for this rule: 30 31 ```proto 32 // Incorrect. 33 // A representation of a book. 34 message Book { 35 // (-- This comment should use Markdown, not HTML.) --) 36 // The name of the book. 37 // Format: <code>publishers/{publisher}/books/{book}</code> 38 string name = 1; 39 } 40 ``` 41 42 **Correct** code for this rule: 43 44 ```proto 45 // Correct. 46 // A representation of a book. 47 message Book { 48 // The name of the book. 49 // Format: `publishers/{publisher}/books/{book}` 50 string name = 1; 51 } 52 ``` 53 54 ## Disabling 55 56 If you need to violate this rule, use a leading comment above the descriptor 57 (and revel in the irony). Remember to also include an [aip.dev/not-precedent][] 58 comment explaining why. 59 60 ```proto 61 // A representation of a book. 62 message Book { 63 // (-- api-linter: core::0192::no-html=disabled 64 // aip.dev/not-precedent: We need to do this because reasons. --) 65 // The name of the book. 66 // Format: <code>publishers/{publisher}/books/{book}</code> 67 string name = 1; 68 } 69 ``` 70 71 [aip-192]: https://aip.dev/192 72 [aip.dev/not-precedent]: https://aip.dev/not-precedent 73 [famous anti-pattern]: https://stackoverflow.com/questions/1732348/