@@ -107,6 +107,7 @@ import {svg, find, hastToReact} from 'property-information'
107
107
import { stringify as spaces } from 'space-separated-tokens'
108
108
import { stringify as commas } from 'comma-separated-tokens'
109
109
import style from 'style-to-object'
110
+ import { uriTransformer } from './uri-transformer.js'
110
111
111
112
const own = { } . hasOwnProperty
112
113
@@ -162,6 +163,10 @@ export function childrenToReact(context, node) {
162
163
*/
163
164
function toReact ( context , node , index , parent ) {
164
165
const options = context . options
166
+ const transform =
167
+ options . transformLinkUri === undefined
168
+ ? uriTransformer
169
+ : options . transformLinkUri
165
170
const parentSchema = context . schema
166
171
/** @type {ReactMarkdownNames } */
167
172
// @ts -expect-error assume a known HTML/SVG element.
@@ -234,8 +239,8 @@ function toReact(context, node, index, parent) {
234
239
: options . linkTarget
235
240
}
236
241
237
- if ( name === 'a' && options . transformLinkUri ) {
238
- properties . href = options . transformLinkUri (
242
+ if ( name === 'a' && transform ) {
243
+ properties . href = transform (
239
244
String ( properties . href || '' ) ,
240
245
node . children ,
241
246
typeof properties . title === 'string' ? properties . title : null
0 commit comments