MCPcopy Index your code
hub / github.com/ether/etherpad / getSpanClassFor

Function getSpanClassFor

src/node/utils/ExportHtml.ts:143–165  ·  view source on GitHub ↗
(i: string)

Source from the content-addressed store, hash-verified

141 const openTags:string[] = [];
142
143 const getSpanClassFor = (i: string) => {
144 // return if author colors are disabled
145 if (!authorColors) return false;
146
147 // @ts-ignore
148 const property = props[i];
149
150 // we are not insterested on properties in the form of ['color', 'red'],
151 // see hook exportHtmlAdditionalTagsWithData
152 if (Array.isArray(property)) {
153 return false;
154 }
155
156 if (property.substr(0, 6) === 'author') {
157 return stripDotFromAuthorID(property);
158 }
159
160 if (property === 'removed') {
161 return 'removed';
162 }
163
164 return false;
165 };
166
167 // tags added by exportHtmlAdditionalTagsWithData will be exported as <span> with
168 // data attributes

Callers 2

emitOpenTagFunction · 0.85
emitCloseTagFunction · 0.85

Calls 1

stripDotFromAuthorIDFunction · 0.85

Tested by

no test coverage detected