@@ -285,6 +285,70 @@ describe("nativeMarkdownDocumentRuns", () => {
285285 ] ) ;
286286 } ) ;
287287
288+ it ( "links web URLs whose host has no dot" , ( ) => {
289+ const runs = nativeMarkdownDocumentRuns ( {
290+ type : "document" ,
291+ children : [
292+ {
293+ type : "paragraph" ,
294+ children : [
295+ {
296+ type : "text" ,
297+ content : "Open http://localhost:3000/path?x=1. (Or https://devbox:8080)" ,
298+ } ,
299+ { type : "code_inline" , content : "http://localhost:5173" } ,
300+ ] ,
301+ } ,
302+ ] ,
303+ } ) ;
304+ expect ( runs ) . toEqual ( [
305+ { text : "Open " , role : "body" } ,
306+ {
307+ text : "http://localhost:3000/path?x=1" ,
308+ role : "body" ,
309+ href : "http://localhost:3000/path?x=1" ,
310+ externalHost : "localhost" ,
311+ } ,
312+ { text : ". (Or " , role : "body" } ,
313+ {
314+ text : "https://devbox:8080" ,
315+ role : "body" ,
316+ href : "https://devbox:8080/" ,
317+ externalHost : "devbox" ,
318+ } ,
319+ { text : ")" , role : "body" } ,
320+ { text : "http://localhost:5173" , role : "body" , code : true } ,
321+ ] ) ;
322+ } ) ;
323+
324+ it ( "links a bold web URL with a port" , ( ) => {
325+ const runs = nativeMarkdownDocumentRuns ( {
326+ type : "document" ,
327+ children : [
328+ {
329+ type : "paragraph" ,
330+ children : [
331+ { type : "text" , content : "Install from " } ,
332+ {
333+ type : "bold" ,
334+ children : [ { type : "text" , content : "https://devbox.tail1234.ts.net:9443/" } ] ,
335+ } ,
336+ ] ,
337+ } ,
338+ ] ,
339+ } ) ;
340+ expect ( runs ) . toEqual ( [
341+ { text : "Install from " , role : "body" } ,
342+ {
343+ text : "https://devbox.tail1234.ts.net:9443/" ,
344+ role : "body" ,
345+ bold : true ,
346+ href : "https://devbox.tail1234.ts.net:9443/" ,
347+ externalHost : "devbox.tail1234.ts.net" ,
348+ } ,
349+ ] ) ;
350+ } ) ;
351+
288352 it ( "copies collapsed skill and file chips back to their original references" , ( ) => {
289353 expect (
290354 nativeMarkdownContextCopyRanges ( [
0 commit comments