Skip to content

Commit

Permalink
Clipper: Fixes #573: Better handling of certain code blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
laurent22 committed Jun 9, 2018
1 parent b826e2d commit 1127eb6
Show file tree
Hide file tree
Showing 9 changed files with 1,666 additions and 1,710 deletions.
2 changes: 1 addition & 1 deletion CliClient/tests/HtmlToMd.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ describe('HtmlToMd', function() {
const htmlPath = basePath + '/' + htmlFilename;
const mdPath = basePath + '/' + filename(htmlFilename) + '.md';

// if (htmlFilename !== 'table_with_colspan.html') continue;
// if (htmlFilename !== 'code_1.html') continue;

const html = await shim.fsDriver().readFile(htmlPath);
const expectedMd = await shim.fsDriver().readFile(mdPath);
Expand Down
8 changes: 8 additions & 0 deletions CliClient/tests/html_to_md/code_1.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<div>
<table><tbody><tr><td class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">def</span> ma_fonction<span style="color: black;">(</span><span style="color: black;">)</span>:
<span style="color: #483d8b;">"""
C'est une super fonction
"""</span>
<span style="color: #ff7700;font-weight:bold;">pass</span></pre></td></tr></tbody></table>

</div>
5 changes: 5 additions & 0 deletions CliClient/tests/html_to_md/code_1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
def ma_fonction():
"""
C'est une super fonction
"""
pass
4 changes: 2 additions & 2 deletions CliClient/tests/test-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ SyncTargetRegistry.addClass(SyncTargetOneDrive);
SyncTargetRegistry.addClass(SyncTargetNextcloud);
SyncTargetRegistry.addClass(SyncTargetDropbox);

const syncTargetId_ = SyncTargetRegistry.nameToId("nextcloud");
// const syncTargetId_ = SyncTargetRegistry.nameToId("memory");
// const syncTargetId_ = SyncTargetRegistry.nameToId("nextcloud");
const syncTargetId_ = SyncTargetRegistry.nameToId("memory");
//const syncTargetId_ = SyncTargetRegistry.nameToId('filesystem');
// const syncTargetId_ = SyncTargetRegistry.nameToId('dropbox');
const syncDir = __dirname + '/../tests/sync';
Expand Down
6 changes: 5 additions & 1 deletion Clipper/joplin-webclipper/popup/src/bridge.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ class Bridge {
this.browser_.runtime.onMessage.addListener(this.browser_notify);

const backgroundPage = this.browser_.extension.getBackgroundPage();
this.env_ = backgroundPage.joplinEnv();

// Not sure why the getBackgroundPage() sometimes returns null, so
// in that case default to "prod" environment, which means the live
// extension won't be affected by this bug.
this.env_ = backgroundPage ? backgroundPage.joplinEnv() : 'prod';

console.info('Popup: Env:', this.env());

Expand Down
Loading

0 comments on commit 1127eb6

Please sign in to comment.