Skip to content

Apply markdown engine to result provider #232

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Mar 27, 2019
Merged

Apply markdown engine to result provider #232

merged 8 commits into from
Mar 27, 2019

Conversation

Vigilans
Copy link
Contributor

@Vigilans Vigilans commented Mar 23, 2019

Introduction

Solving #216 (comment)

Demonstration

image

image

image

image

@Vigilans Vigilans requested a review from jdneo March 23, 2019 14:35
@jdneo
Copy link
Member

jdneo commented Mar 23, 2019

This pull request introduces 3 alerts when merging 4bb9018 into bcafa92 - view on LGTM.com

new alerts:

  • 2 for Useless assignment to local variable
  • 1 for Unused variable, import, function or class

Comment posted by LGTM.com

@Vigilans
Copy link
Contributor Author

Currently, the parsing does not cover this case:
image

However, the [Warn] line will be parsed as one part of √ Your runtime..., so maybe its visual effect will not be so ugly.

If there is issue about it in the future, further logic can be added at that time.

return `<!DOCTYPE html>
<html lang="en">
private parseResult(raw: string): IResult {
raw = raw.concat(" √ "); // Append a dummy sentinel to the end of raw string
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What will happen if we don't append ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The RegEx captures anything in between two . If we don't append it, the last section (normally stdout) won't be captured.

Worth to note that, with this trick, messages like [WARN] Failed to get memory percentile will be captured as one part of Your runtime beats 81.3 % of python submissions, and will also be printed out even it does not starts with .

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm... still feeling the logic here is too tricky for maintaince.

It's ok to merge for now.

@jdneo jdneo merged commit 4eefc70 into LeetCode-OpenSource:master Mar 27, 2019
@Vigilans Vigilans deleted the webview-md-result branch August 22, 2019 08:02
@Vigilans Vigilans restored the webview-md-result branch August 22, 2019 08:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants