frantic / copy-with-syntax Goto Github PK
View Code? Open in Web Editor NEWCopy buffer content with syntax highlighting
Home Page: http://frantic.im/copy-with-syntax
License: MIT License
Copy buffer content with syntax highlighting
Home Page: http://frantic.im/copy-with-syntax
License: MIT License
Maybe there is a way to figure out what's actually selected and copy only that part
I am using Atom 1.13.0 x64 on Ubuntu 16.10. I tried copying from Atom to Evernote Web. It copies plain text but not formatted text. Any idea ?
Currently invisible characters are also copied (screenshot).
Simple fix could be:
// ·
.replace(/\267/g, ' ')
// »
.replace(/\273 /g, ' ')
// ¬
.replace(/\254/g, '')
// ¤
.replace(/\244/g, '')
In this case lose part of text
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
<xsl:template match="/">
Version: <xsl:value-of select="system-property(’xsl:version’)" />
Vendor: <xsl:value-of select="system-property(’xsl:vendor’)" />
Vendor URL: <xsl:value-of select="system-property(’xsl:vendor-url’)" />
</xsl:template>
</xsl:stylesheet>
in result get:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
<xsl:template match="/">
Version: <xsl:value-of select= />
Vendor: <xsl:value-of select= />
Vendor URL: <xsl:value-of select= />
</xsl:template>
</xsl:stylesheet>
¬â€
Limitation of the way this plugin works, fixing would probably mean taking completely different approach.
Atom does some optimizations behind the scenes to render only what's actually going to be visible on the screen.
The contents of atom-text-editor
elements are no longer encapsulated
within a shadow DOM boundary. Please, stop using shadowRoot
and access
the editor contents directly instead.
atom-text-editor.Object.defineProperty.get (/private/var/folders/kc/5sz0jdf14l10gvlqd4vt3_c80000gn/T/AppTranslocation/61529E22-31FD-4C09-9E60-C15C57B2177A/d/Atom.app/Contents/Resources/app.asar/src/text-editor-element.js:68:18)
atom-workspace.copyWithSyntax (/Users/Jb/.atom/packages/copy-with-syntax/lib/copy-with-syntax.js:9:31)
CommandRegistry.handleCommandEvent (/private/var/folders/kc/5sz0jdf14l10gvlqd4vt3_c80000gn/T/AppTranslocation/61529E22-31FD-4C09-9E60-C15C57B2177A/d/Atom.app/Contents/Resources/app.asar/src/command-registry.js:259:29)
<unknown> (/private/var/folders/kc/5sz0jdf14l10gvlqd4vt3_c80000gn/T/AppTranslocation/61529E22-31FD-4C09-9E60-C15C57B2177A/d/Atom.app/Contents/Resources/app.asar/src/command-registry.js:3:59)
KeymapManager.dispatchCommandEvent (/private/var/folders/kc/5sz0jdf14l10gvlqd4vt3_c80000gn/T/AppTranslocation/61529E22-31FD-4C09-9E60-C15C57B2177A/d/Atom.app/Contents/Resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:599:16)
KeymapManager.handleKeyboardEvent (/private/var/folders/kc/5sz0jdf14l10gvlqd4vt3_c80000gn/T/AppTranslocation/61529E22-31FD-4C09-9E60-C15C57B2177A/d/Atom.app/Contents/Resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:390:22)
The contents of atom-text-editor
elements are no longer encapsulated
within a shadow DOM boundary. Please, stop using shadowRoot
and access
the editor contents directly instead.
HTMLElement.shadowRoot (C:\Users\Akira\AppData\Local\atom\app-1.19.0\resources\app\src\text-editor-element.js:13:10)
HTMLElement.copyWithSyntax (C:\Users\Akira\.atom\packages\copy-with-syntax\lib\copy-with-syntax.js:9:31)
CommandRegistry.handleCommandEvent (<embedded>:21847:35)
<unknown> (<embedded>:21585:65)
KeymapManager.dispatchCommandEvent (<embedded>:66698:22)
KeymapManager.handleKeyboardEvent (<embedded>:66489:28)
When copied this text:
// Todas as unidades são métricas
Got it:
// Todas as unidades são métricas
Copying results in the following plain text being pasted into Outlook.
(Windows environment)
{\rtf1\ansi\ansicpg1252
{\fonttbl\f0\fnil\fcharset0 Menlo,Consolas,"DejaVuSansMono",monospace-Regular;\f1\fnil\fcharset0 Menlo,Consolas,"DejaVuSansMono",monospace-Bold;\f2\fnil\fcharset0 Menlo,Consolas,"DejaVuSansMono",monospace-Italic;}
{\colortbl;\red56\green58\blue66;\red56\green58\blue66;\red228\green86\blue73;\red80\green161\blue79;}
\f0\fs24
\cf1 { \line \cf2 \cf3 "sobjects"\cf1 : { \line \cf2 \cf3 "my-contact"\cf1 : { \line \cf2 \cf3 "type"\cf1 : \cf4 "Contact"\cf1 , \line \cf2 \cf3 "insertFields"\cf1 :[\cf4 "*"\cf1 ], \line \cf2 \cf3 "updateFields"\cf1 :[\cf4 "Email"\cf1 ,\cf4 "Phone"\cf1 ,\cf4 "MobilePhone"\cf1 ], \line \cf2 \cf3
...etc
When I copy:
I got in Word:
{\rtf1\ansi\ansicpg1252 {\fonttbl\f0\fnil\fcharset0 Menlo,Consolas,"DejaVuSansMono",monospace-Regular;\f1\fnil\fcharset0 Menlo,Consolas,"DejaVuSansMono",monospace-Bold;\f2\fnil\fcharset0 Menlo,Consolas,"DejaVuSansMono",monospace-Italic;} {\colortbl;\red202\green18\blue67;\red56\green58\blue66;\red64\green120\blue242;\red56\green58\blue66;\red80\green161\blue79;\red166\green38\blue164;\red1\green132\blue188;\red228\green86\blue73;\red152\green104\blue1;\red193\green132\blue1;} \f0\fs24 \cf1 <?php \line \cf2 \cf3 include\cf4 (\cf5 "dbConnect.php"\cf4 ); \line \cf2 \cf6 if\cf4 (!\cf7 isset\cf4 (\cf8 $_SESSION\cf4 [\cf5 'email'\cf4 ])) \{ \line \cf2 \cf8 $_SESSION\cf4 [\cf5 'message'\cf4 ] = \cf5 "Musisz się zalogować!"\cf4 ; \line \cf2 \cf7 header\cf4 (\cf5 'location: login.php'\cf4 ); \line \cf2 \cf4 \} \line \cf2 \cf6 if\cf4 (\cf7 isset\cf4 (\cf8 $_GET\cf4 [\cf5 'logout'\cf4 ])) \{ \line \cf2 \cf7 session_destroy\cf4 (); \line \cf2 \cf7 unset\cf4 (\cf8 $_SESSION\cf4 [\cf5 'user'\cf4 ]); \line \cf2 \cf7 header\cf4 (\cf5 "location: login.php"\cf4 ); \line \cf2 \cf4 \} \line \cf2 \cf3 include\cf4 (\cf5 "header.php"\cf4 ); \line \cf1 ?> \line \cf4 \line <\cf8 body\cf4 \cf3 id\cf4 =\cf5 "page-top"\cf4 > \line \cf2 \cf4 <\cf8 div\cf4 \cf3 id\cf4 =\cf5 "wrapper"\cf4 > \line \cf2 \cf1 <?php\cf4 \cf3 include\cf4 (\cf5 "nav.php"\cf4 ); \cf1 ?> \line \cf2 \cf4 <\cf8 div\cf4 \cf3 id\cf4 =\cf5 "content-wrapper"\cf4 \cf9 class\cf10 =\cf5 "d-flex flex-column"\cf4 > \line \cf2 \cf4 <\cf8 div\cf4 \cf3 id\cf4 =\cf5 "content"\cf4 > \line \cf2 \cf1 <?php\cf4 \cf3 include\cf4 (\cf5 "topbar.php"\cf4 ); \cf1 ?> \line \cf2 \cf4 <\cf8 div\cf4 \cf9 class\cf10 =\cf5 "container-fluid"\cf4 > \line \cf2 \cf4 <\cf8 h1\cf4 \cf9 class\cf10 =\cf5 "h3 mb-4 text-gray-800"\cf4 >Zarządzaj zadaniami</\cf8 h1\cf4 > \line \cf2 \cf1 <?php \line \cf2 \cf6 if\cf4 (!\cf8 $results_manage_tasks_get_tasks_projects_users\cf4 || \cf3 mysqli_num_rows\cf4 (\cf8 $results_manage_tasks_get_tasks_projects_users\cf4 ) == \cf9 0\cf4 ) \{ \line \cf2 \cf7 echo \line \cf2 \cf5 '<div class="col-lg mb-4"> \line \cf2 \cf5 <div class="card bg-warning text-white shadow"> \line \cf2 \cf5 <div class="card-body" style="text-align: center"> \line \cf2 \cf5 Brak zadań do wyświetlenia! \line \cf2 \cf5 </div> \line \cf2 \cf5 </div> \line \cf2 \cf5 </div>'\cf4 ; \line \cf2 \line \cf4 \} \line \cf2 \cf6 else \line \cf2 \cf4 \{ \line }
[Enter steps to reproduce:]
Atom: 1.21.2 x64
Electron: 1.6.15
OS: Microsoft Windows 7 Ultimate
Thrown From: copy-with-syntax package 0.0.3
Uncaught TypeError: Cannot read property 'shadowRoot' of undefined
At C:\Users\Patrick\.atom\packages\copy-with-syntax\lib\copy-with-syntax.js:9
TypeError: Cannot read property 'shadowRoot' of undefined
at HTMLElement.copyWithSyntax (/packages/copy-with-syntax/lib/copy-with-syntax.js:9:31)
at CommandRegistry.handleCommandEvent (~/AppData/Local/atom/app-1.21.2/resources/app/src/command-registry.js:381:36)
at Object.didConfirmSelection (~/AppData/Local/atom/app-1.21.2/resources/app/node_modules/command-palette/lib/command-palette-view.js:144:35)
at SelectListView.confirmSelection (~/AppData/Local/atom/app-1.21.2/resources/app/node_modules/command-palette/node_modules/atom-select-list/src/select-list-view.js:327:26)
at SelectListView.didClickItem (~/AppData/Local/atom/app-1.21.2/resources/app/node_modules/command-palette/node_modules/atom-select-list/src/select-list-view.js:242:16)
at ListItemView.onclick (~/AppData/Local/atom/app-1.21.2/resources/app/node_modules/command-palette/node_modules/atom-select-list/src/select-list-view.js:181:39)
at ListItemView.didClick (~/AppData/Local/atom/app-1.21.2/resources/app/node_modules/command-palette/node_modules/atom-select-list/src/select-list-view.js:375:16)
3x -6:55.6.0 core:save (input.hidden-input)
-5:02.7.0 core:copy (span.syntax--storage.syntax--modifier.syntax--c)
2x -0:50.6.0 command-palette:toggle (div.alert.alert-danger.alert-dismissable.native-key-bindings)
-0:27.5.0 copy-with-syntax:copy (div.panels-item)
copy-as-rtf 0.9.3
copy-with-syntax 0.0.3
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.