Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions src/microsoft-learn-mock/src/interactivity/originalCode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,21 @@ export function getUrls(): { trydotnetUrl: string, trydotnetOrigin: string } {

if (window) {
let params = new URLSearchParams(window.location.search);
ret.trydotnetUrl = params.get('trydotnetUrl') || trydotnetUrl;
ret.trydotnetOrigin = params.get('trydotnetOrigin') || trydotnetOrigin;
const paramUrl = params.get('trydotnetUrl');
if (paramUrl && paramUrl.startsWith('/') && !paramUrl.startsWith('//')) {
ret.trydotnetUrl = paramUrl;
}
const paramOrigin = params.get('trydotnetOrigin');
if (paramOrigin) {
try {
const url = new URL(paramOrigin);
if (url.protocol === 'https:' && (url.hostname === 'trydotnet.microsoft.com' || url.hostname.endsWith('.microsoft.com'))) {
ret.trydotnetOrigin = paramOrigin;
}
} catch {
// invalid URL, use default
}
}
}
return ret;
}
Expand Down
105 changes: 55 additions & 50 deletions src/microsoft-trydotnet-editor/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/microsoft-trydotnet-editor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"@types/tmp": "^0.2.6",
"@typescript-eslint/eslint-plugin": "^5.62.0",
"@typescript-eslint/parser": "^5.62.0",
"chai": "4.3.6",
"chai": "4.5.0",
"chai-as-promised": "8.0.2",
"css-loader": "^7.1.4",
"eslint": "8.18.0",
Expand Down
12 changes: 2 additions & 10 deletions src/microsoft-trydotnet-styles/sass/trydotnet.scss
Original file line number Diff line number Diff line change
Expand Up @@ -117,20 +117,12 @@ footer {
}
}

.code-container,
.code-container-inline {
position: relative;
margin-top: 1em;
margin-bottom: 1em;
padding: 01px;
border: 1px solid #ab9ce0;
border-left: 4px solid #ab9ce0;
}

.code-container {
position: relative;
margin-top: 1em;
margin-bottom: 1em;
padding: 01px;
padding: 1px;
border: 1px solid #ab9ce0;
border-left: 4px solid #ab9ce0;
}
Expand Down
3 changes: 3 additions & 0 deletions src/microsoft-trydotnet/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/microsoft-trydotnet/test/sessionFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ export function createReadySession(configuration: Configuration, editorIFrame: H

export function createReadySessionWithMultipleEditors(configuration: Configuration, editorIFrames: HTMLIFrameElement[], window: DOMWindow): Promise<ISession> {
let awaitableSession = createSession(configuration, editorIFrames, window as unknown as Window);
for (let editorIframe of editorIFrames) {
notifyEditorReadyWithId(configuration, window, editorIframe.dataset.trydotnetEditorId!);
for (let editorIFrame of editorIFrames) {
notifyEditorReadyWithId(configuration, window, editorIFrame.dataset.trydotnetEditorId!);
}
return awaitableSession;
}