File tree Expand file tree Collapse file tree 1 file changed +10
-7
lines changed
apps/api-documenter/src/markdown Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change 11// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
22// See LICENSE in the project root for license information.
33
4+ import * as colors from 'colors' ;
45import * as path from 'path' ;
56
67import {
@@ -606,14 +607,16 @@ export class MarkdownDocumenter {
606607 onRenderApiLink : ( args : IMarkdownRenderApiLinkArgs ) => {
607608 const resolveResult : IDocItemSetResolveResult = this . _docItemSet . resolveApiItemReference ( args . reference ) ;
608609 if ( ! resolveResult . docItem ) {
609- throw new Error ( 'Unresolved: ' + JSON . stringify ( args . reference ) ) ;
610+ // Eventually we should introduce a warnings file
611+ console . error ( colors . yellow ( 'Warning: Unresolved hyperlink to '
612+ + Markup . formatApiItemReference ( args . reference ) ) ) ;
613+ } else {
614+ // NOTE: GitHub's markdown renderer does not resolve relative hyperlinks correctly
615+ // unless they start with "./" or "../".
616+ const docFilename : string = './' + this . _getFilenameForDocItem ( resolveResult . docItem ) ;
617+ args . prefix = '[' ;
618+ args . suffix = '](' + docFilename + ')' ;
610619 }
611-
612- // NOTE: GitHub's markdown renderer does not resolve relative hyperlinks correctly
613- // unless they start with "./" or "../".
614- const docFilename : string = './' + this . _getFilenameForDocItem ( resolveResult . docItem ) ;
615- args . prefix = '[' ;
616- args . suffix = '](' + docFilename + ')' ;
617620 }
618621 } ) ;
619622
You can’t perform that action at this time.
0 commit comments