@@ -11,18 +11,18 @@ export default function renderDoc(note: FNote) {
1111 if ( docName ) {
1212 // find doc based on language
1313 const url = getUrl ( docName , getCurrentLanguage ( ) ) ;
14- $content . load ( url , ( response , status ) => {
14+ $content . load ( url , async ( response , status ) => {
1515 // fallback to english doc if no translation available
1616 if ( status === "error" ) {
1717 const fallbackUrl = getUrl ( docName , "en" ) ;
18- $content . load ( fallbackUrl , ( ) => {
19- processContent ( fallbackUrl , $content )
18+ $content . load ( fallbackUrl , async ( ) => {
19+ await processContent ( fallbackUrl , $content )
2020 resolve ( $content ) ;
2121 } ) ;
2222 return ;
2323 }
2424
25- processContent ( url , $content ) ;
25+ await processContent ( url , $content ) ;
2626 resolve ( $content ) ;
2727 } ) ;
2828 } else {
@@ -33,7 +33,7 @@ export default function renderDoc(note: FNote) {
3333 } ) ;
3434}
3535
36- function processContent ( url : string , $content : JQuery < HTMLElement > ) {
36+ async function processContent ( url : string , $content : JQuery < HTMLElement > ) {
3737 const dir = url . substring ( 0 , url . lastIndexOf ( "/" ) ) ;
3838
3939 // Images are relative to the docnote but that will not work when rendered in the application since the path breaks.
@@ -45,7 +45,7 @@ function processContent(url: string, $content: JQuery<HTMLElement>) {
4545 formatCodeBlocks ( $content ) ;
4646
4747 // Apply reference links.
48- applyReferenceLinks ( $content [ 0 ] ) ;
48+ await applyReferenceLinks ( $content [ 0 ] ) ;
4949}
5050
5151function getUrl ( docNameValue : string , language : string ) {
0 commit comments