Skip to content
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

Allow to add Code Snippets With Syntax Highlighting support (without need for extension) #658

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

aviade
Copy link

@aviade aviade commented Jul 26, 2017

Added support for adding Code Snippets as a first class feature.

Users will be able to write code (or paste coed) on the editor, and mark it as 'Code' just like they can mark a URL as 'Hyperlink'. As a result, the code should be rendered with syntax highlighting.

@aviade aviade closed this Aug 9, 2017
@aviade aviade reopened this Aug 9, 2017
Copy link
Member

@ScottIsAFool ScottIsAFool left a comment

Choose a reason for hiding this comment

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

Code-wise, this looks fine. However, I think it would be good to get a better visual indicator in the editor when you have inserted some code. At the moment you may not know you've already inserted code using this new approach and end up doing it again. Even if it's something as simple as a dotted box around the code segment, something like that.

@OpenLiveWriter OpenLiveWriter deleted a comment from dnfclas Dec 6, 2017
@OpenLiveWriter OpenLiveWriter deleted a comment from dnfclas Dec 6, 2017
@OpenLiveWriter OpenLiveWriter deleted a comment from dnfclas Dec 6, 2017
@Sambardo
Copy link

Is the visual indicator all that's keeping this from merging with the master and being available?

@jongalloway jongalloway mentioned this pull request Apr 12, 2018
@tugberkugurlu
Copy link

What stops this to be merged?

private const string DEFAULT_SKIN = CodeHighlighterSkins.Sunburst;

private static readonly string _prettifyScript =
$"<script src=\"https://cdn.rawgit.com/google/code-prettify/master/loader/{PRETTIFY_SCRIPT_NAME}?skin={DEFAULT_SKIN}\"></script>";
Copy link
Member

Choose a reason for hiding this comment

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

https://rawgit.com/ is currently in sunset and will be shut-down by October. Whatever service is used instead, the user should be informed that a third-party script is being inserted into their site, and a third-party service is used to fetch it. Use of subresource integrity would also be desired.

Choose a reason for hiding this comment

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

I found this site that produces HTML for pretty printing code, and it has an API you can call:

http://hilite.me/

I've not yet worked out what this PR is actually doing, so I haven't any ideas on how to use it to update this PR, but thought I'd mention it in case some one else can use it to update this PR, or else explain what this code is doing so that I can attempt to update it.

@rkingett
Copy link

I hope this won't break screen reader support in the new editor. Perhaps we can integrate some automated accessibility checks to be reviewed by a human later? 2 possible choices are below.

  1. AccessLint.
  2. pa11y. May work with more software source code.

@manzanotti
Copy link

I've just downloaded the archive for the Precode plugin for Windows Live Writer, though it is also a WPF app. Do you think there's any mileage in looking at the source code for it and seeing if it could be easily ported to OLW?

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.

None yet

10 participants