mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-25 01:46:14 -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
|
@ -665,6 +665,7 @@ Context properties:
|
|||
Example:
|
||||
|
||||
```javascript
|
||||
const AttributeMap = require('ep_etherpad-lite/static/js/AttributeMap');
|
||||
const Changeset = require('ep_etherpad-lite/static/js/Changeset');
|
||||
|
||||
exports.getLineHTMLForExport = async (hookName, context) => {
|
||||
|
@ -672,7 +673,7 @@ exports.getLineHTMLForExport = async (hookName, context) => {
|
|||
const opIter = Changeset.opIterator(context.attribLine);
|
||||
if (!opIter.hasNext()) return;
|
||||
const op = opIter.next();
|
||||
const heading = Changeset.opAttributeValue(op, 'heading', apool);
|
||||
const heading = AttributeMap.fromString(op.attribs, context.apool).get('heading');
|
||||
if (!heading) return;
|
||||
context.lineContent = `<${heading}>${context.lineContent}</${heading}>`;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue