@@ -3232,6 +3232,11 @@ const runUpdateLinks = () => {
32323232 id : "43417628" ,
32333233 metadata : { editor : "v2" , fileName : "authoring/hello-world5.xml" } ,
32343234 } ,
3235+ [ "special-characters.qmd" ] : {
3236+ title : "Special Characters !@#$%^&*(){}|?//\\" ,
3237+ id : "123456" ,
3238+ metadata : { fileName : "special-characters.xml" } ,
3239+ } ,
32353240 } ;
32363241
32373242 const UPDATE_NO_LINKS : ContentUpdate = {
@@ -3269,6 +3274,23 @@ const runUpdateLinks = () => {
32693274 fileName : "release-planning.xml" ,
32703275 } ;
32713276
3277+ const UPDATE_LINKS_SPECIAL_CHAR : ContentUpdate = {
3278+ contentChangeType : ContentChangeType . update ,
3279+ id : "19890228" ,
3280+ version : null ,
3281+ title : "Release Planning" ,
3282+ type : "page" ,
3283+ status : "current" ,
3284+ ancestors : [ { id : "19759105" } ] ,
3285+ body : {
3286+ storage : {
3287+ value : "<a href='special-characters.qmd'>team</a>" ,
3288+ representation : "storage" ,
3289+ } ,
3290+ } ,
3291+ fileName : "release-planning.xml" ,
3292+ } ;
3293+
32723294 const UPDATE_LINKS_ONE_NESTED_DOT_SLASH : ContentUpdate = {
32733295 contentChangeType : ContentChangeType . update ,
32743296 id : "43778049" ,
@@ -3394,7 +3416,7 @@ const runUpdateLinks = () => {
33943416 ...UPDATE_LINKS_ONE ,
33953417 body : {
33963418 storage : {
3397- value : `<a href=\'no-replace.qmd\'/>no</a> content content <a href=\'fake-server/wiki/spaces/QUARTOCONF/pages/19857455/Team\ '>team</a> content content <a href=\'zqmdzz.qmd\'>team</a>` ,
3419+ value : `<a href=\'no-replace.qmd\'/>no</a> content content <a href=\'fake-server/wiki/spaces/QUARTOCONF/pages/19857455'>team</a> content content <a href=\'zqmdzz.qmd\'>team</a>` ,
33983420 representation : "storage" ,
33993421 } ,
34003422 } ,
@@ -3411,7 +3433,23 @@ const runUpdateLinks = () => {
34113433 ) ;
34123434 } ) ;
34133435
3414- test ( suiteLabel ( "one_update_link_nested_dot_slash" ) , async ( ) => {
3436+ test ( suiteLabel ( "one_update_link_special_char" ) , async ( ) => {
3437+ const changes : ConfluenceSpaceChange [ ] = [ UPDATE_LINKS_SPECIAL_CHAR ] ;
3438+ const rootURL = "fake-server/wiki/spaces/QUARTOCONF/pages" ;
3439+ const expectedUpdate : ContentUpdate = {
3440+ ...UPDATE_LINKS_ONE ,
3441+ body : {
3442+ storage : {
3443+ value : `<a href=\'fake-server/wiki/spaces/QUARTOCONF/pages/123456'>team</a>` ,
3444+ representation : "storage" ,
3445+ } ,
3446+ } ,
3447+ } ;
3448+ const expected : ConfluenceSpaceChange [ ] = [ expectedUpdate ] ;
3449+ check ( expected , changes , fileMetadataTable , "fake-server" , FAKE_PARENT ) ;
3450+ } ) ;
3451+
3452+ otest ( suiteLabel ( "one_update_link_nested_dot_slash" ) , async ( ) => {
34153453 const changes : ConfluenceSpaceChange [ ] = [
34163454 UPDATE_LINKS_ONE_NESTED_DOT_SLASH ,
34173455 ] ;
@@ -3420,7 +3458,7 @@ const runUpdateLinks = () => {
34203458 ...UPDATE_LINKS_ONE_NESTED_DOT_SLASH ,
34213459 body : {
34223460 storage : {
3423- value : `<a href=\'fake-server/wiki/spaces/QUARTOCONF/pages/43417628/Hello%20World5\ '>Hello World 5</a>` ,
3461+ value : `<a href=\'fake-server/wiki/spaces/QUARTOCONF/pages/43417628'>Hello World 5</a>` ,
34243462 representation : "storage" ,
34253463 } ,
34263464 } ,
@@ -3436,7 +3474,7 @@ const runUpdateLinks = () => {
34363474 ...UPDATE_LINKS_ONE_NESTED ,
34373475 body : {
34383476 storage : {
3439- value : `<a href=\'fake-server/wiki/spaces/QUARTOCONF/pages/43417628/Hello%20World5\ '>Hello World 5</a>` ,
3477+ value : `<a href=\'fake-server/wiki/spaces/QUARTOCONF/pages/43417628'>Hello World 5</a>` ,
34403478 representation : "storage" ,
34413479 } ,
34423480 } ,
@@ -3452,7 +3490,7 @@ const runUpdateLinks = () => {
34523490 ...UPDATE_LINKS_ONE_NESTED_ABS ,
34533491 body : {
34543492 storage : {
3455- value : `<a href=\'fake-server/wiki/spaces/QUARTOCONF/pages/19890228/Release%20Planning\ '>Release Planning</a>` ,
3493+ value : `<a href=\'fake-server/wiki/spaces/QUARTOCONF/pages/19890228'>Release Planning</a>` ,
34563494 representation : "storage" ,
34573495 } ,
34583496 } ,
@@ -3469,7 +3507,7 @@ const runUpdateLinks = () => {
34693507 body : {
34703508 storage : {
34713509 value :
3472- "<a href='no-replace.qmd'/>no</a> content content <a href='fake-server/wiki/spaces/QUARTOCONF/pages/19857455/Team #Fake-Anchor'>team</a> content content <a href='zqmdzz.qmd'>team</a>" ,
3510+ "<a href='no-replace.qmd'/>no</a> content content <a href='fake-server/wiki/spaces/QUARTOCONF/pages/19857455#Fake-Anchor'>team</a> content content <a href='zqmdzz.qmd'>team</a>" ,
34733511 representation : "storage" ,
34743512 } ,
34753513 } ,
@@ -3493,7 +3531,7 @@ const runUpdateLinks = () => {
34933531 ...UPDATE_LINKS_ONE ,
34943532 body : {
34953533 storage : {
3496- value : `<a href='no-replace.qmd'/>not-found</a> content content <a href='fake-server/wiki/spaces/QUARTOCONF/pages/19857455/Team '>teamz</a> content content <a href='zqmdzz.qmd'>not-found</a> <a href='fake-server/wiki/spaces/QUARTOCONF/pages/19890228/Release%20Planning '>Do the Release Planning</a> and then triage.qmd .qmd <a href='fake-server/wiki/spaces/QUARTOCONF/pages/19890180/Issue%20Triage '>triage.qmd</a>` ,
3534+ value : `<a href='no-replace.qmd'/>not-found</a> content content <a href='fake-server/wiki/spaces/QUARTOCONF/pages/19857455'>teamz</a> content content <a href='zqmdzz.qmd'>not-found</a> <a href='fake-server/wiki/spaces/QUARTOCONF/pages/19890228'>Do the Release Planning</a> and then triage.qmd .qmd <a href='fake-server/wiki/spaces/QUARTOCONF/pages/19890180'>triage.qmd</a>` ,
34973535 representation : "storage" ,
34983536 } ,
34993537 } ,
@@ -3520,7 +3558,7 @@ const runUpdateLinks = () => {
35203558 ...UPDATE_LINKS_ONE ,
35213559 body : {
35223560 storage : {
3523- value : `<a href='no-replace.qmd'/>not-found</a> content content <a href='fake-server/wiki/spaces/QUARTOCONF/pages/19857455/Team '>teamz</a> content content <a href='zqmdzz.qmd'>not-found</a> <a href='fake-server/wiki/spaces/QUARTOCONF/pages/19890228/Release%20Planning '>Do the Release Planning</a> and then triage.qmd .qmd <a href='fake-server/wiki/spaces/QUARTOCONF/pages/19890180/Issue%20Triage '>triage.qmd</a>` ,
3561+ value : `<a href='no-replace.qmd'/>not-found</a> content content <a href='fake-server/wiki/spaces/QUARTOCONF/pages/19857455'>teamz</a> content content <a href='zqmdzz.qmd'>not-found</a> <a href='fake-server/wiki/spaces/QUARTOCONF/pages/19890228'>Do the Release Planning</a> and then triage.qmd .qmd <a href='fake-server/wiki/spaces/QUARTOCONF/pages/19890180'>triage.qmd</a>` ,
35243562 representation : "storage" ,
35253563 } ,
35263564 } ,
@@ -3530,7 +3568,7 @@ const runUpdateLinks = () => {
35303568 ...UPDATE_LINKS_ONE ,
35313569 body : {
35323570 storage : {
3533- value : `<a href='no-replace.qmd'/>no</a> content content <a href='fake-server/wiki/spaces/QUARTOCONF/pages/19857455/Team '>team</a> content content <a href='zqmdzz.qmd'>team</a>` ,
3571+ value : `<a href='no-replace.qmd'/>no</a> content content <a href='fake-server/wiki/spaces/QUARTOCONF/pages/19857455'>team</a> content content <a href='zqmdzz.qmd'>team</a>` ,
35343572 representation : "storage" ,
35353573 } ,
35363574 } ,
@@ -3800,7 +3838,7 @@ const runConvertForSecondPass = () => {
38003838 ...UPDATE_LINKS_ONE ,
38013839 body : {
38023840 storage : {
3803- value : `<a href=\'no-replace.qmd\'/>no</a> content content <a href=\'fake-server/wiki/spaces/QUARTOCONF/pages/19857455/Team\ '>team</a> content content <a href=\'zqmdzz.qmd\'>team</a>` ,
3841+ value : `<a href=\'no-replace.qmd\'/>no</a> content content <a href=\'fake-server/wiki/spaces/QUARTOCONF/pages/19857455'>team</a> content content <a href=\'zqmdzz.qmd\'>team</a>` ,
38043842 representation : "storage" ,
38053843 } ,
38063844 } ,
@@ -3816,7 +3854,7 @@ const runConvertForSecondPass = () => {
38163854 ...UPDATE_LINKS_ONE ,
38173855 body : {
38183856 storage : {
3819- value : `<a href=\'no-replace.qmd\'/>no</a> content content <a href=\'fake-server/wiki/spaces/QUARTOCONF/pages/19857456/TeamTest\ '>team</a> content content <a href=\'zqmdzz.qmd\'>team</a>` ,
3857+ value : `<a href=\'no-replace.qmd\'/>no</a> content content <a href=\'fake-server/wiki/spaces/QUARTOCONF/pages/19857456'>team</a> content content <a href=\'zqmdzz.qmd\'>team</a>` ,
38203858 representation : "storage" ,
38213859 } ,
38223860 } ,
@@ -3832,7 +3870,7 @@ const runConvertForSecondPass = () => {
38323870 ...UPDATE_LINKS_ONE ,
38333871 body : {
38343872 storage : {
3835- value : `<a href=\'no-replace.qmd\'/>no</a> content content <a href=\'fake-server/wiki/spaces/QUARTOCONF/pages/19857455/Team\ '>team</a> content content <a href=\'zqmdzz.qmd\'>team</a>` ,
3873+ value : `<a href=\'no-replace.qmd\'/>no</a> content content <a href=\'fake-server/wiki/spaces/QUARTOCONF/pages/19857455'>team</a> content content <a href=\'zqmdzz.qmd\'>team</a>` ,
38363874 representation : "storage" ,
38373875 } ,
38383876 } ,
@@ -4133,5 +4171,5 @@ if (RUN_ALL_TESTS) {
41334171 runUpdateImagePathsForContentBody ( ) ;
41344172 runCapFirstLetter ( ) ;
41354173} else {
4136- runConvertForSecondPass ( ) ;
4174+ runUpdateLinks ( ) ;
41374175}
0 commit comments