File tree Expand file tree Collapse file tree 2 files changed +8
-9
lines changed
Expand file tree Collapse file tree 2 files changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -100,10 +100,7 @@ export class DynamicHtmlAdapter implements IAdapter {
100100 return context
101101 }
102102
103- private _handleMutations (
104- element : HTMLElement ,
105- context : IContextNode
106- ) {
103+ private _handleMutations ( element : HTMLElement , context : IContextNode ) {
107104 const parsedContext = this . parser . parseContext ( element , context . contextType )
108105 const pairs = this . parser . findChildElements ( element , context . contextType )
109106 const insPoints = this . _findAvailableInsPoints ( element , context . contextType )
Original file line number Diff line number Diff line change @@ -9,15 +9,17 @@ function tryParseUrl(text: string): URL | null {
99}
1010
1111export class LinkParser implements IParser {
12- parseContext ( { href, innerText } : HTMLAnchorElement ) {
12+ parseContext ( element : HTMLAnchorElement , contextName : string ) {
13+ if ( contextName === 'root' ) return { id : 'global' }
14+
1315 // ToDo: twitter-specific logic. Twitter adds '…' to the end of the url
14- const cleanUrl = innerText . replace ( / … $ / g, '' )
16+ const cleanUrl = element . innerText . replace ( / … $ / g, '' )
1517
1618 return {
17- id : href ,
18- href : href ,
19+ id : element . href ,
20+ href : element . href ,
1921 innerHref : tryParseUrl ( cleanUrl ) ?. href ,
20- innerText : innerText ,
22+ innerText : element . innerText ,
2123 }
2224 }
2325
You can’t perform that action at this time.
0 commit comments