mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-22 08:26:16 -04:00
Changeset: Migrate to the new attribute API
This commit is contained in:
parent
f40d285109
commit
f1eb7a25a6
15 changed files with 175 additions and 210 deletions
|
@ -19,6 +19,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
const AttributeMap = require('../../static/js/AttributeMap');
|
||||
const Changeset = require('../../static/js/Changeset');
|
||||
|
||||
exports.getPadPlainText = (pad, revNum) => {
|
||||
|
@ -54,7 +55,8 @@ exports._analyzeLine = (text, aline, apool) => {
|
|||
const opIter = Changeset.opIterator(aline);
|
||||
if (opIter.hasNext()) {
|
||||
const op = opIter.next();
|
||||
let listType = Changeset.opAttributeValue(op, 'list', apool);
|
||||
const attribs = AttributeMap.fromString(op.attribs, apool);
|
||||
let listType = attribs.get('list');
|
||||
if (listType) {
|
||||
lineMarker = 1;
|
||||
listType = /([a-z]+)([0-9]+)/.exec(listType);
|
||||
|
@ -63,7 +65,7 @@ exports._analyzeLine = (text, aline, apool) => {
|
|||
line.listLevel = Number(listType[2]);
|
||||
}
|
||||
}
|
||||
const start = Changeset.opAttributeValue(op, 'start', apool);
|
||||
const start = attribs.get('start');
|
||||
if (start) {
|
||||
line.start = start;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue