Code review notifications are broken

%3CLINGO-SUB%20id%3D%22lingo-sub-3429790%22%20slang%3D%22en-US%22%3ECode%20review%20notifications%20are%20broken%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3429790%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3EWe%20are%20using%20Azure%20DevOps%20on-premise%20and%20for%20every%20project%20I'm%20working%20on%2C%20I%20have%20notifications%20enabled%20for%20Code%20Reviews%20changes.%20The%20problem%20is%20that%20when%20I%20receive%20the%20email%2C%20it%20is%20all%20broken%3A%3C%2FP%3E%3COL%3E%3CLI%3EThe%20comments%20get%20replace%20by%20something%20like%20the%20result%20of%20OriginalComment.Replace(%22%5Cr%5Cn%22%2C%20%22%3CBR%20%2F%3E%22)%3C%2FLI%3E%3CLI%3EThe%20date%20gets%20an%20invalid%20format.%20From%20the%20result%2C%20I%20suppose%20something%20like%20%22jjj%20MM-jj-aaaa%20hh%3Amm%20ss%22.%20Note%20that%20everything%20is%20fine%20when%20we%20open%20it%20in%20the%20web%20interface.%3C%2FLI%3E%3C%2FOL%3E%3CP%3EMy%202%20questions%3A%3C%2FP%3E%3COL%3E%3CLI%3EIs%20there%20any%20template%20we%20could%20modify%20to%20fix%20this%3F%3C%2FLI%3E%3CLI%3EIs%20there%20a%20setting%20for%20notifications%20date%20format%3F%3C%2FLI%3E%3C%2FOL%3E%3CP%3EHere%20is%20a%20sample%20from%20one%20of%20the%20broken%20email%20(Show%20Source).%20As%20you%20can%20see%2C%20%3CBR%20%2F%3E%20tags%20are%20added%20between%20each%20word%20%3CSTRONG%3Eexcept%3C%2FSTRONG%3E%20where%20I%20enter%20a%20real%20line%20break%20in%20the%20original%20comment.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3E%20%20%20%20%20%20%20%20%3CDIV%3E%3CSPAN%3EFileUnderReview.vb%3C%2FSPAN%3E%3C%2FDIV%3E%0A%20%20%20%20%20%20%20%20%3CDIV%20style%3D%22%20margin-left%3A%201em%3B%20margin-top%3A%200.5em%3B%20margin-bottom%3A%200.5em%22%3E%0A%20%20%20%20%20%20%20%20%20%20%3CDIV%20style%3D%22margin-top%3A%200.25em%3B%20margin-bottom%3A%200.25em%3B%20color%3A%20%23888%22%3E%3CSTRONG%3EBobby%20Kay%3C%2FSTRONG%3E%3CDIV%3ECommentaires%3CBR%20%2F%3Edans%3CBR%20%2F%3El'autre%3CBR%20%2F%3ECode%3CBR%20%2F%3EReview%3C%2FDIV%3Ejjj%2003-jj-aaaa%204%3A12%2004%3C%2FDIV%3E%0A%20%20%20%20%20%20%20%20%20%20%3CDIV%20style%3D%22margin-top%3A%200.25em%3B%20margin-bottom%3A%200.25em%3B%20color%3A%20%23888%22%3E%3CSTRONG%3EBobby%20Kay%3C%2FSTRONG%3E%3CDIV%3EJe%3CBR%20%2F%3Epense%3CBR%20%2F%3Epas%3CBR%20%2F%3Eavoir%3CBR%20%2F%3Evu%3CBR%20%2F%3E%C3%A7a%3CBR%20%2F%3Eavant%3CBR%20%2F%3Emais%3CBR%20%2F%3Ecette%3CBR%20%2F%3Eligne%3CBR%20%2F%3Epourrait%3CBR%20%2F%3E%C3%AAtre%3CBR%20%2F%3Esimplifi%C3%A9e%3CBR%20%2F%3Een%3A%0AIf%3CBR%20%2F%3ETypeOf%3CBR%20%2F%3Enode.FirstNode%3F.Tag%3CBR%20%2F%3EIs%3CBR%20%2F%3EPathNodeInfo%3CBR%20%2F%3EThen%3C%2FDIV%3E%0A%20%20%20%20%20%20%20%20Ligne%2058%20%7C%0A%20%20%20%20%20%20jjj%2003-jj-aaaa%204%3A12%2004%3CDIV%20style%3D%22border-left%3A%204px%20solid%20%23ccc%3B%20padding-left%3A%201em%3B%22%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3CDIV%20style%3D%22margin-top%3A%200.25em%3B%20margin-bottom%3A%200.25em%3B%20color%3A%20%23888%22%3E%3CSTRONG%3EJohn%20Doe%3C%2FSTRONG%3E%3CDIV%3EJe%3CBR%20%2F%3Edirais%3CBR%20%2F%3Eraccourci%3CBR%20%2F%3Eplut%C3%B4t%3CBR%20%2F%3Eque%3CBR%20%2F%3Esimplifi%C3%A9e!%3CBR%20%2F%3EJe%3CBR%20%2F%3Evais%3CBR%20%2F%3Ela%3CBR%20%2F%3Elaisser%3CBR%20%2F%3Ecomme%3CBR%20%2F%3E%C3%A7a%3CBR%20%2F%3Epour%3CBR%20%2F%3El'instant%3C%2FDIV%3Ejjj%2005-jj-aaaa%203%3A04%2003%3C%2FDIV%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%3C%2FDIV%3E%0A%20%20%20%20%20%20%20%20%20%20%3C%2FDIV%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3BAnd%20the%20same%20comments%20in%20the%20web%20UI%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3E%3CDIV%20class%3D%22flex-grow%20repos-discussion-thread%20flex-column%20flex-grow%20scroll-hidden%22%3E%3CDIV%20class%3D%22repos-discussion-comment%20flex-column%20has-replies%22%3E%3CDIV%20class%3D%22flex-column%22%3E%3CDIV%20class%3D%22flex-row%22%3E%3CDIV%3E%3CDIV%20class%3D%22bolt-coin%20flex-noshrink%20repos-comment-header-persona%20size24%20cursor-pointer%22%20data-is-focusable%3D%22true%22%20tabindex%3D%220%22%20role%3D%22button%22%20aria-label%3D%22Bobby%20Kay%22%3E%3CIMG%20class%3D%22bolt-coin-content%20using-image%20size24%22%20src%3D%22http%3A%2F%2Ftfsserver%3A8080%2Ftfs%2Fsite_a%2F_apis%2FGraphProfile%2FMemberAvatars%2Fwin.Uy0xLTUtMjEtMTM5MDA2NzM1Ny0xNzcwMDI3MzcyLTE0MTcwMDEzMzMtMTA0MTc3%3Fsize%3D0%22%20alt%3D%22Bobby%20Kay%22%20%2F%3E%3C%2FDIV%3E%3C%2FDIV%3E%3CDIV%20class%3D%22flex-column%20flex-grow%20scroll-hidden%20padding-left-8%22%3E%3CDIV%20class%3D%22repos-discussion-comment-header%20flex-row%20flex-grow%20flex-center%20rhythm-horizontal-4%20margin-bottom-8%22%3E%3CDIV%20class%3D%22scroll-hidden%20flex-row%20flex-center%22%3E%3CSPAN%20class%3D%22font-weight-semibold%20padding-right-8%20text-ellipsis%22%3EBobby%20Kay%3C%2FSPAN%3E%3CDIV%20class%3D%22flex-row%20flex-center%20rhythm-horizontal-4%20margin-left-4%22%3E%3CSPAN%20class%3D%22text-ellipsis%22%20aria-label%3D%2218%20mars%202020%2018%20mars%202020%20%C3%A0%2016%20h%2012%20HAE%22%3E%3CTIME%20class%3D%22body-s%20secondary-text%20margin-right-4%20bolt-time-item%20white-space-nowrap%22%20datetime%3D%222020-03-18T20%3A12%3A07.327Z%22%3E18%20mars%202020%3C%2FTIME%3E%3C%2FSPAN%3E%3C%2FDIV%3E%3C%2FDIV%3E%3CDIV%20class%3D%22flex-row%20flex-grow%20flex-noshrink%20justify-end%20flex-center%22%3E%3CBUTTON%20aria-label%3D%22Modifier%22%20class%3D%22repos-discussion-comment-auto-hide-button%20bolt-button%20bolt-icon-button%20enabled%20subtle%20icon-only%20bolt-focus-treatment%22%20data-focuszone%3D%22focuszone-176%22%20data-is-focusable%3D%22true%22%20role%3D%22button%22%20tabindex%3D%220%22%20type%3D%22button%22%3E%3CSPAN%20aria-hidden%3D%22true%22%20class%3D%22repos-discussion-comment-auto-hide%20left-icon%20flex-noshrink%20fabric-icon%20ms-Icon--Edit%20medium%22%3E%3C%2FSPAN%3E%3C%2FBUTTON%3E%3CBUTTON%20aria-label%3D%22Supprimer%22%20class%3D%22repos-discussion-comment-auto-hide-button%20bolt-button%20bolt-icon-button%20enabled%20subtle%20icon-only%20bolt-focus-treatment%22%20data-focuszone%3D%22focuszone-176%22%20data-is-focusable%3D%22true%22%20role%3D%22button%22%20tabindex%3D%22-1%22%20type%3D%22button%22%3E%3CSPAN%20aria-hidden%3D%22true%22%20class%3D%22repos-discussion-comment-auto-hide%20left-icon%20flex-noshrink%20fabric-icon%20ms-Icon--Delete%20medium%22%3E%3C%2FSPAN%3E%3C%2FBUTTON%3E%3CDIV%20class%3D%22bolt-dropdown-expandable%20bolt-expandable-button%20inline-flex-row%22%3E%3CBUTTON%20aria-disabled%3D%22false%22%20aria-expanded%3D%22false%22%20aria-haspopup%3D%22true%22%20class%3D%22bolt-button%20enabled%20subtle%20bolt-focus-treatment%22%20data-focuszone%3D%22focuszone-176%22%20data-is-focusable%3D%22true%22%20role%3D%22button%22%20tabindex%3D%22-1%22%20type%3D%22button%22%3E%3CDIV%20class%3D%22bolt-dropdown-expandable-button-label%20justify-start%20flex-grow%20text-ellipsis%22%3EActif%3C%2FDIV%3E%3CSPAN%20aria-hidden%3D%22true%22%20class%3D%22icon-right%20font-weight-normal%20flex-noshrink%20fabric-icon%20ms-Icon--ChevronDownMed%20small%22%3E%3C%2FSPAN%3E%3C%2FBUTTON%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3CDIV%20class%3D%22markdown-content%20markdown-editor-preview%20repos-comment-editor-max-width%22%3E%3CP%3EJe%20pense%20pas%20avoir%20vu%20%C3%A7a%20avant%20mais%20cette%20ligne%20pourrait%20%C3%AAtre%20simplifi%C3%A9e%20en%3A%3CBR%20%2F%3E%0AIf%20TypeOf%20node.FirstNode%3F.Tag%20Is%20PathNodeInfo%20Then%3C%2FP%3E%0A%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3CDIV%20class%3D%22repos-discussion-comment%20flex-column%22%3E%3CDIV%20class%3D%22flex-column%22%3E%3CDIV%20class%3D%22flex-row%22%3E%3CDIV%3E%3CDIV%20class%3D%22bolt-coin%20flex-noshrink%20repos-comment-header-persona%20size24%20cursor-pointer%22%20data-is-focusable%3D%22true%22%20tabindex%3D%220%22%20role%3D%22button%22%20aria-label%3D%22John%20Doe%22%3E%3CIMG%20class%3D%22bolt-coin-content%20using-image%20size24%22%20src%3D%22http%3A%2F%2Ftfsserver%3A8080%2Ftfs%2Fsite_a%2F_apis%2FGraphProfile%2FMemberAvatars%2Fwin.Uy0xLTUtMjEtMTM5MDA2NzM1Ny0xNzcwMDI3MzcyLTE0MTcwMDEzMzMtNDI3NTIy%3Fsize%3D0%22%20alt%3D%22John%20Doe%22%20%2F%3E%3C%2FDIV%3E%3C%2FDIV%3E%3CDIV%20class%3D%22flex-column%20flex-grow%20scroll-hidden%20padding-left-8%22%3E%3CDIV%20class%3D%22repos-discussion-comment-header%20flex-row%20flex-grow%20flex-center%20rhythm-horizontal-4%20margin-bottom-8%22%3E%3CDIV%20class%3D%22scroll-hidden%20flex-row%20flex-center%22%3E%3CSPAN%20class%3D%22font-weight-semibold%20padding-right-8%20text-ellipsis%22%3EJohn%20Doe%3C%2FSPAN%3E%3CDIV%20class%3D%22flex-row%20flex-center%20rhythm-horizontal-4%20margin-left-4%22%3E%3CSPAN%20class%3D%22text-ellipsis%22%20aria-label%3D%228%20mai%202020%208%20mai%202020%20%C3%A0%2015%20h%2004%20HAE%22%3E%3CTIME%20class%3D%22body-s%20secondary-text%20margin-right-4%20bolt-time-item%20white-space-nowrap%22%20datetime%3D%222020-05-08T19%3A04%3A26.820Z%22%3E8%20mai%202020%3C%2FTIME%3E%3C%2FSPAN%3E%3C%2FDIV%3E%3C%2FDIV%3E%3CDIV%20class%3D%22flex-row%20flex-grow%20flex-noshrink%20justify-end%20flex-center%22%3E%3C%2FDIV%3E%3C%2FDIV%3E%3CDIV%20class%3D%22markdown-content%20markdown-editor-preview%20repos-comment-editor-max-width%22%3E%3CP%3EJe%20dirais%20raccourci%20plut%C3%B4t%20que%20simplifi%C3%A9e!%20Je%20vais%20la%20laisser%20comme%20%C3%A7a%20pour%20l'instant%3C%2FP%3E%0A%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3CDIV%20class%3D%22repos-discussion-thread-reply%20flex-column%22%3E%3CDIV%20class%3D%22flex-row%20flex-grow%20rhythm-horizontal-8%22%3E%3CDIV%3E%3CDIV%20class%3D%22bolt-coin%20flex-noshrink%20margin-right-4%20margin-top-4%20size24%20cursor-pointer%22%20data-is-focusable%3D%22true%22%20tabindex%3D%220%22%20role%3D%22button%22%20aria-label%3D%22Bobby%20Kay%22%3E%3CIMG%20class%3D%22bolt-coin-content%20using-image%20size24%22%20src%3D%22http%3A%2F%2Ftfsserver%3A8080%2Ftfs%2Fsite_a%2F_apis%2FGraphProfile%2FMemberAvatars%2Fwin.Uy0xLTUtMjEtMTM5MDA2NzM1Ny0xNzcwMDI3MzcyLTE0MTcwMDEzMzMtMTA0MTc3%3Fsize%3D0%22%20alt%3D%22Bobby%20Kay%22%20%2F%3E%3C%2FDIV%3E%3C%2FDIV%3E%3CDIV%20class%3D%22flex-row%20flex-grow%20flex-center%20rhythm-horizontal-8%20repos-comment-editor-max-width%22%3E%3CDIV%20class%3D%22flex-column%20flex-grow%20padding-vertical-4%22%3E%3CDIV%20class%3D%22bolt-textfield%20flex-row%20flex-center%20focus-treatment%22%3E%3CINPUT%20autocomplete%3D%22off%22%20aria-label%3D%22%C3%89crire%20une%20r%C3%A9ponse...%22%20data-focuszone%3D%22focuszone-175%22%20class%3D%22bolt-textfield-input%20flex-grow%22%20id%3D%22__bolt-textfield-input-30%22%20placeholder%3D%22%C3%89crire%20une%20r%C3%A9ponse...%22%20tabindex%3D%220%22%20value%3D%22%22%20%2F%3E%3C%2FDIV%3E%3C%2FDIV%3E%3CBUTTON%20class%3D%22bolt-button%20enabled%20bolt-focus-treatment%22%20data-focuszone%3D%22focuszone-175%22%20data-is-focusable%3D%22true%22%20role%3D%22button%22%20tabindex%3D%220%22%20type%3D%22button%22%3ER%C3%A9soudre%3C%2FBUTTON%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CEM%3E%3CSTRONG%3EEdit%202022-05-30%3A%3C%2FSTRONG%3E%3C%2FEM%3E%3C%2FP%3E%3CP%3EFor%20point%20%231%2C%20I%20found%20that%20the%20problem%20seems%20to%20come%20from%20I%20found%20that%20the%20problem%20seems%20to%20come%20from%20the%26nbsp%3Blinefeed2br%20template%20in%20the%20CodeReviewChangedEvent.xsl%20file.%20When%20I%20test%20it%20with%20a%20mock%20xml%2C%20I%20get%20the%20exact%20same%20behavior%20where%20the%20spaces%20(ascii%2032)%20are%20replaced%20with%20%3CBR%20%2F%3E%20as%20if%20they%20were%20in%20fact%20new%20lines%20(ascii%20x0D%2C%20x0A).%20I%20replicated%20the%20problem%20using%20the%20%3CA%20href%3D%22https%3A%2F%2Fwww.w3schools.com%2FXML%2Ftryxslt.asp%3Fxmlfile%3Dcdcatalog%26amp%3Bxsltfile%3Dcdcatalog%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3Eonline%20parser%20from%20W3School.%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3E%20%20%3CTEMPLATE%20name%3D%22linefeed2br%22%3E%0A%20%20%20%20%3COBJECT%3E%3CPARAM%20name%3D%22StringToTransform%22%20%2F%3E%0A%20%20%20%20%3CCHOOSE%3E%0A%20%20%20%20%20%20%3C!--%20Does%20the%20string%20contain%20a%20linefeed%3F%20--%3E%0A%20%20%20%20%20%20%3CWHEN%20test%3D%22contains(%24StringToTransform%2C'%0A')%22%3E%0A%20%20%20%20%20%20%20%20%3C!--%20find%20the%20linefeed%20and%20output%20the%20substring%20that%20comes%20before%20it%20--%3E%0A%20%20%20%20%20%20%20%20%3CVALUE-OF%20select%3D%22substring-before(%24StringToTransform%2C'%0A')%22%3E%3C%2FVALUE-OF%3E%0A%20%20%20%20%20%20%20%20%3C!--%20remove%20the%20line%20feed%20and%20replace%20with%20a%20%3Cbr%20%2F%3E%20%20--%3E%0A%20%20%20%20%20%20%20%20%3CBR%20%2F%3E%0A%20%20%20%20%20%20%20%20%3C!--%20repeat%20--%3E%0A%20%20%20%20%20%20%20%20%3CCALL-TEMPLATE%20name%3D%22linefeed2br%22%3E%0A%20%20%20%20%20%20%20%20%20%20%3CWITH-PARAM%20name%3D%22StringToTransform%22%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%3CVALUE-OF%20select%3D%22substring-after(%24StringToTransform%2C'%0A')%22%3E%3C%2FVALUE-OF%3E%0A%20%20%20%20%20%20%20%20%20%20%3C%2FWITH-PARAM%3E%0A%20%20%20%20%20%20%20%20%3C%2FCALL-TEMPLATE%3E%0A%20%20%20%20%20%20%3C%2FWHEN%3E%0A%20%20%20%20%20%20%3C!--%20string%20does%20not%20contain%20newline%2C%20so%20just%20output%20it%20--%3E%0A%20%20%20%20%20%20%3COTHERWISE%3E%0A%20%20%20%20%20%20%20%20%3CVALUE-OF%20select%3D%22%24StringToTransform%22%3E%3C%2FVALUE-OF%3E%0A%20%20%20%20%20%20%3C%2FOTHERWISE%3E%0A%20%20%20%20%3C%2FCHOOSE%3E%0A%20%20%3C%2FOBJECT%3E%3C%2FTEMPLATE%3E%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhat%20is%20even%20weirder%20is%20that%20no%20matter%20the%20character%26nbsp%3B%20use%20(%26amp%3B%2310%2C%20%26amp%3B%23x0D%2C%20%26amp%3B%23x0A%2C%20%5Breal%20new%20line%5D)%2C%20the%20space%20char%20is%20always%20replace%20and%20the%20new%20line%2C%20never.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CEM%3E%3CSTRONG%3EEdit%202022-05-30%20%232%3A%3C%2FSTRONG%3E%3C%2FEM%3E%3C%2FP%3E%3CP%3EI%20tested%20a%20%3CA%20href%3D%22https%3A%2F%2Fwww.freeformatter.com%2Fxsl-transformer.html%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Edifferent%20online%20parser%2C%20this%20time%20from%26nbsp%3Bwww.freeformatter.com%3C%2FA%3E%2C%20and%20this%20time%2C%20it%20works%20with%20%26amp%3B%2310%20though%20it%20was%20also%20broken%20with%20the%20real%20new%20line.%20I%20now%20have%20to%20wait%20for%20my%20server%20administrator%20to%20try%20this%20new%20version%20of%20the%20template%20to%20see%20if%20it%20works.%20I%20added%20the%202%20files%20I%20used.%20Note%20that%20this%20is%20a%20fr-ca%20regionalized%20installation.%3C%2FP%3E%3C%2FDIV%3E%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E
Frequent Visitor

Hi,

We are using Azure DevOps on-premise and for every project I'm working on, I have notifications enabled for Code Reviews changes. The problem is that when I receive the email, it is all broken:

  1. The comments get replace by something like the result of OriginalComment.Replace("\r\n", "<br>")
  2. The date gets an invalid format. From the result, I suppose something like "jjj MM-jj-aaaa hh:mm ss". Note that everything is fine when we open it in the web interface.

My 2 questions:

  1. Is there any template we could modify to fix this?
  2. Is there a setting for notifications date format?

Here is a sample from one of the broken email (Show Source). As you can see, <br> tags are added between each word except where I enter a real line break in the original comment.

 

 

        <div><span>FileUnderReview.vb</span></div>
        <div style=" margin-left: 1em; margin-top: 0.5em; margin-bottom: 0.5em">
          <div style="margin-top: 0.25em; margin-bottom: 0.25em; color: #888"><strong>Bobby Kay</strong><div>Commentaires<br>dans<br>l'autre<br>Code<br>Review</div>jjj 03-jj-aaaa 4:12 04</div>
          <div style="margin-top: 0.25em; margin-bottom: 0.25em; color: #888"><strong>Bobby Kay</strong><div>Je<br>pense<br>pas<br>avoir<br>vu<br>ça<br>avant<br>mais<br>cette<br>ligne<br>pourrait<br>être<br>simplifiée<br>en:
If<br>TypeOf<br>node.FirstNode?.Tag<br>Is<br>PathNodeInfo<br>Then</div>
        Ligne 58 |
      jjj 03-jj-aaaa 4:12 04<div style="border-left: 4px solid #ccc; padding-left: 1em;">
              <div style="margin-top: 0.25em; margin-bottom: 0.25em; color: #888"><strong>John Doe</strong><div>Je<br>dirais<br>raccourci<br>plutôt<br>que<br>simplifiée!<br>Je<br>vais<br>la<br>laisser<br>comme<br>ça<br>pour<br>l'instant</div>jjj 05-jj-aaaa 3:04 03</div>
            </div>
          </div>

 

 

 

 And the same comments in the web UI:

 

 

<div class="flex-grow repos-discussion-thread flex-column flex-grow scroll-hidden"><div class="repos-discussion-comment flex-column has-replies"><div class="flex-column"><div class="flex-row"><div><div class="bolt-coin flex-noshrink repos-comment-header-persona size24 cursor-pointer" data-is-focusable="true" tabindex="0" role="button" aria-label="Bobby Kay"><img class="bolt-coin-content using-image size24" src="http://tfsserver:8080/tfs/site_a/_apis/GraphProfile/MemberAvatars/win.Uy0xLTUtMjEtMTM5MDA2NzM1Ny0xNzcwMDI3MzcyLTE0MTcwMDEzMzMtMTA0MTc3?size=0" alt="Bobby Kay"></div></div><div class="flex-column flex-grow scroll-hidden padding-left-8"><div class="repos-discussion-comment-header flex-row flex-grow flex-center rhythm-horizontal-4 margin-bottom-8"><div class="scroll-hidden flex-row flex-center"><span class="font-weight-semibold padding-right-8 text-ellipsis">Bobby Kay</span><div class="flex-row flex-center rhythm-horizontal-4 margin-left-4"><span class="text-ellipsis" aria-label="18 mars 2020 18 mars 2020 à 16 h 12 HAE"><time class="body-s secondary-text margin-right-4 bolt-time-item white-space-nowrap" datetime="2020-03-18T20:12:07.327Z">18 mars 2020</time></span></div></div><div class="flex-row flex-grow flex-noshrink justify-end flex-center"><button aria-label="Modifier" class="repos-discussion-comment-auto-hide-button bolt-button bolt-icon-button enabled subtle icon-only bolt-focus-treatment" data-focuszone="focuszone-176" data-is-focusable="true" role="button" tabindex="0" type="button"><span aria-hidden="true" class="repos-discussion-comment-auto-hide left-icon flex-noshrink fabric-icon ms-Icon--Edit medium"></span></button><button aria-label="Supprimer" class="repos-discussion-comment-auto-hide-button bolt-button bolt-icon-button enabled subtle icon-only bolt-focus-treatment" data-focuszone="focuszone-176" data-is-focusable="true" role="button" tabindex="-1" type="button"><span aria-hidden="true" class="repos-discussion-comment-auto-hide left-icon flex-noshrink fabric-icon ms-Icon--Delete medium"></span></button><div class="bolt-dropdown-expandable bolt-expandable-button inline-flex-row"><button aria-disabled="false" aria-expanded="false" aria-haspopup="true" class="bolt-button enabled subtle bolt-focus-treatment" data-focuszone="focuszone-176" data-is-focusable="true" role="button" tabindex="-1" type="button"><div class="bolt-dropdown-expandable-button-label justify-start flex-grow text-ellipsis">Actif</div><span aria-hidden="true" class="icon-right font-weight-normal flex-noshrink fabric-icon ms-Icon--ChevronDownMed small"></span></button></div></div></div><div class="markdown-content markdown-editor-preview repos-comment-editor-max-width"><p>Je pense pas avoir vu ça avant mais cette ligne pourrait être simplifiée en:<br>
If TypeOf node.FirstNode?.Tag Is PathNodeInfo Then</p>
</div></div></div></div></div><div class="repos-discussion-comment flex-column"><div class="flex-column"><div class="flex-row"><div><div class="bolt-coin flex-noshrink repos-comment-header-persona size24 cursor-pointer" data-is-focusable="true" tabindex="0" role="button" aria-label="John Doe"><img class="bolt-coin-content using-image size24" src="http://tfsserver:8080/tfs/site_a/_apis/GraphProfile/MemberAvatars/win.Uy0xLTUtMjEtMTM5MDA2NzM1Ny0xNzcwMDI3MzcyLTE0MTcwMDEzMzMtNDI3NTIy?size=0" alt="John Doe"></div></div><div class="flex-column flex-grow scroll-hidden padding-left-8"><div class="repos-discussion-comment-header flex-row flex-grow flex-center rhythm-horizontal-4 margin-bottom-8"><div class="scroll-hidden flex-row flex-center"><span class="font-weight-semibold padding-right-8 text-ellipsis">John Doe</span><div class="flex-row flex-center rhythm-horizontal-4 margin-left-4"><span class="text-ellipsis" aria-label="8 mai 2020 8 mai 2020 à 15 h 04 HAE"><time class="body-s secondary-text margin-right-4 bolt-time-item white-space-nowrap" datetime="2020-05-08T19:04:26.820Z">8 mai 2020</time></span></div></div><div class="flex-row flex-grow flex-noshrink justify-end flex-center"></div></div><div class="markdown-content markdown-editor-preview repos-comment-editor-max-width"><p>Je dirais raccourci plutôt que simplifiée! Je vais la laisser comme ça pour l'instant</p>
</div></div></div></div></div><div class="repos-discussion-thread-reply flex-column"><div class="flex-row flex-grow rhythm-horizontal-8"><div><div class="bolt-coin flex-noshrink margin-right-4 margin-top-4 size24 cursor-pointer" data-is-focusable="true" tabindex="0" role="button" aria-label="Bobby Kay"><img class="bolt-coin-content using-image size24" src="http://tfsserver:8080/tfs/site_a/_apis/GraphProfile/MemberAvatars/win.Uy0xLTUtMjEtMTM5MDA2NzM1Ny0xNzcwMDI3MzcyLTE0MTcwMDEzMzMtMTA0MTc3?size=0" alt="Bobby Kay"></div></div><div class="flex-row flex-grow flex-center rhythm-horizontal-8 repos-comment-editor-max-width"><div class="flex-column flex-grow padding-vertical-4"><div class="bolt-textfield flex-row flex-center focus-treatment"><input autocomplete="off" aria-label="Écrire une réponse..." data-focuszone="focuszone-175" class="bolt-textfield-input flex-grow" id="__bolt-textfield-input-30" placeholder="Écrire une réponse..." tabindex="0" value=""></div></div><button class="bolt-button enabled bolt-focus-treatment" data-focuszone="focuszone-175" data-is-focusable="true" role="button" tabindex="0" type="button">Résoudre</button></div></div></div></div>

 

 

Edit 2022-05-30:

For point #1, I found that the problem seems to come from I found that the problem seems to come from the linefeed2br template in the CodeReviewChangedEvent.xsl file. When I test it with a mock xml, I get the exact same behavior where the spaces (ascii 32) are replaced with <br/> as if they were in fact new lines (ascii x0D, x0A). I replicated the problem using the online parser from W3School.

 

  <xsl:template name="linefeed2br">
    <xsl:param name="StringToTransform"/>
    <xsl:choose>
      <!-- Does the string contain a linefeed? -->
      <xsl:when test="contains($StringToTransform,'
')">
        <!-- find the linefeed and output the substring that comes before it -->
        <xsl:value-of select="substring-before($StringToTransform,'
')"/>
        <!-- remove the line feed and replace with a <br />  -->
        <br/>
        <!-- repeat -->
        <xsl:call-template name="linefeed2br">
          <xsl:with-param name="StringToTransform">
            <xsl:value-of select="substring-after($StringToTransform,'
')"/>
          </xsl:with-param>
        </xsl:call-template>
      </xsl:when>
      <!-- string does not contain newline, so just output it -->
      <xsl:otherwise>
        <xsl:value-of select="$StringToTransform"/>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:template>

 

What is even weirder is that no matter the character  use (&#10, &#x0D, &#x0A, [real new line]), the space char is always replace and the new line, never.

 

Edit 2022-05-30 #2:

I tested a different online parser, this time from www.freeformatter.com, and this time, it works with &#10 though it was also broken with the real new line. I now have to wait for my server administrator to try this new version of the template to see if it works. I added the 2 files I used. Note that this is a fr-ca regionalized installation.

0 Replies