cleanCommentMarkers — strip comment syntax, keep the prose.
(comment: &str)
| 103 | |
| 104 | /// cleanCommentMarkers — strip comment syntax, keep the prose. |
| 105 | pub fn clean_comment_markers(comment: &str) -> String { |
| 106 | let c = cleaners(); |
| 107 | let mut s = comment.trim().to_string(); |
| 108 | if s.starts_with("/*") { |
| 109 | s = c.block_open.replace(&s, "").into_owned(); |
| 110 | s = c.block_close.replace(&s, "").into_owned(); |
| 111 | } else if s.starts_with("--[") { |
| 112 | s = c.lua_open.replace(&s, "").into_owned(); |
| 113 | s = c.lua_close.replace(&s, "").into_owned(); |
| 114 | } else if s.starts_with("(*") { |
| 115 | s = c.paren_star_open.replace(&s, "").into_owned(); |
| 116 | s = c.paren_star_close.replace(&s, "").into_owned(); |
| 117 | } else if s.starts_with('{') { |
| 118 | s = c.brace_open.replace(&s, "").into_owned(); |
| 119 | s = c.brace_close.replace(&s, "").into_owned(); |
| 120 | } |
| 121 | s = js_multiline_strip(&s, &c.slashes); |
| 122 | s = js_multiline_strip(&s, &c.dashes); |
| 123 | s = js_multiline_strip(&s, &c.hash); |
| 124 | s = js_multiline_strip(&s, &c.percent); |
| 125 | s = js_multiline_strip(&s, &c.star_cont); |
| 126 | s.trim().to_string() |
| 127 | } |
| 128 | |
| 129 | /// getPrecedingDocstring — collect the comment run immediately preceding the |
| 130 | /// node (climbing out of declaration wrappers first), cleaned and joined. |
no test coverage detected