Skip to content

Commit

Permalink
feat(json-crdt-extensions): 🎸 print human-readable block type
Browse files Browse the repository at this point in the history
  • Loading branch information
streamich committed Nov 11, 2024
1 parent 23fc35d commit c125938
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/json-crdt-extensions/peritext/block/Block.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {MarkerOverlayPoint} from '../overlay/MarkerOverlayPoint';
import type {OverlayPoint} from '../overlay/OverlayPoint';
import {UndefEndIter, type UndefIterator} from '../../../util/iterator';
import {Inline} from './Inline';
import {formatType} from '../slice/util';
import type {Path} from '@jsonjoy.com/json-pointer';
import type {Printable} from 'tree-dump';
import type {Peritext} from '../Peritext';
Expand Down Expand Up @@ -144,7 +145,7 @@ export class Block<Attr = unknown> implements IBlock, Printable, Stateful {
}
protected toStringHeader(): string {
const hash = `#${this.hash.toString(36).slice(-4)}`;
const tag = `<${this.path.join('.')}>`;
const tag = this.path.map(step => formatType(step)).join('.');
const header = `${this.toStringName()} ${hash} ${tag}`;
return header;
}
Expand Down

0 comments on commit c125938

Please sign in to comment.