@@ -16,7 +16,6 @@ import { jest } from '@jest/globals'
1616
1717import { frontmatter , deprecatedProperties } from '../../../lib/frontmatter.js'
1818import languages from '../../../lib/languages.js'
19- import { tags } from '#src/content-render/liquid/extended-markdown.js'
2019import releaseNotesSchema from '../lib/release-notes-schema.js'
2120import learningTracksSchema from '../lib/learning-tracks-schema.js'
2221import { renderContent , liquid } from '#src/content-render/index.js'
@@ -170,13 +169,6 @@ const oldVariableRegex = /{{\s*?site\.data\..*?}}/g
170169//
171170const oldOcticonRegex = / { { \s * ?o c t i c o n - ( [ a - z - ] + ) ( \s [ \w \s \d - ] + ) ? \s * ?} } / g
172171
173- // - {{#note}}
174- // - {{/note}}
175- // - {{ #warning }}
176- // - {{ /pizza }}
177- //
178- const oldExtendedMarkdownRegex = / { { \s * ?[ # / ] [ a - z - ] + \s * ?} } / g
179-
180172// GitHub-owned actions (e.g. actions/checkout@v2) should use a reusable in examples.
181173// list:
182174// - actions/checkout@v2
@@ -211,8 +203,6 @@ const oldVariableErrorText =
211203 'Found article uses old {{ site.data... }} syntax. Use {% data example.data.string %} instead!'
212204const oldOcticonErrorText =
213205 'Found octicon variables with the old {{ octicon-name }} syntax. Use {% octicon "name" %} instead!'
214- const oldExtendedMarkdownErrorText =
215- 'Found extended markdown tags with the old {{#note}} syntax. Use {% note %}/{% endnote %} instead!'
216206const literalActionInsteadOfReusableErrorText =
217207 'Found a literal mention of a GitHub-owned action. Instead, use the reusables for the action. e.g {% data reusables.actions.action-checkout %}'
218208
@@ -596,21 +586,6 @@ describe('lint markdown content', () => {
596586 expect ( matches . length , errorMessage ) . toBe ( 0 )
597587 } )
598588
599- test ( 'does not use old extended markdown syntax' , async ( ) => {
600- Object . keys ( tags ) . forEach ( ( tag ) => {
601- const reg = new RegExp ( `{{\\s*?[#|/]${ tag } ` , 'g' )
602- if ( reg . test ( content ) ) {
603- const matches = content . match ( oldExtendedMarkdownRegex ) || [ ]
604- const tagMessage = oldExtendedMarkdownErrorText
605- . replace ( '{{#note}}' , `{{#${ tag } }}` )
606- . replace ( '{% note %}' , `{% ${ tag } %}` )
607- . replace ( '{% endnote %}' , `{% end${ tag } %}` )
608- const errorMessage = formatLinkError ( tagMessage , matches )
609- expect ( matches . length , errorMessage ) . toBe ( 0 )
610- }
611- } )
612- } )
613-
614589 test ( 'URLs must not contain a hard-coded language code' , async ( ) => {
615590 const matches = links . filter ( ( link ) => {
616591 return / \/ (?: $ { languageCodes.j o i n ( ' | ' ) } ) \/ / . test ( link )
@@ -895,22 +870,6 @@ describe('lint yaml content', () => {
895870 const errorMessage = formatLinkError ( oldOcticonErrorText , matches )
896871 expect ( matches . length , errorMessage ) . toBe ( 0 )
897872 } )
898-
899- test ( 'does not use old extended markdown syntax' , async ( ) => {
900- const matches = [ ]
901-
902- for ( const [ key , content ] of Object . entries ( dictionary ) ) {
903- const contentStr = getContent ( content )
904- if ( ! contentStr ) continue
905- const valMatches = contentStr . match ( oldExtendedMarkdownRegex ) || [ ]
906- if ( valMatches . length > 0 ) {
907- matches . push ( ...valMatches . map ( ( match ) => `Key "${ key } ": ${ match } ` ) )
908- }
909- }
910-
911- const errorMessage = formatLinkError ( oldExtendedMarkdownErrorText , matches )
912- expect ( matches . length , errorMessage ) . toBe ( 0 )
913- } )
914873 } )
915874} )
916875
0 commit comments