Skip to content

Commit

Permalink
commenting out code that dies in some browsers
Browse files Browse the repository at this point in the history
confirmed failure in firefox and chrome for os x
  • Loading branch information
hstoebel committed Jul 29, 2017
1 parent 17b3a8d commit 1a75466
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/sql/magic.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,10 @@ def _persist_dataframe(self, raw, conn, user_ns):

def load_ipython_extension(ip):
"""Load the extension in IPython."""
js = "IPython.CodeCell.config_defaults.highlight_modes['magic_sql'] = {'reg':[/^%%sql/]};"
display_javascript(js, raw=True)

# this fails in both Firefox and Chrome for OS X.
# I get the error: TypeError: IPython.CodeCell.config_defaults is undefined

# js = "IPython.CodeCell.config_defaults.highlight_modes['magic_sql'] = {'reg':[/^%%sql/]};"
# display_javascript(js, raw=True)
ip.register_magics(SqlMagic)

1 comment on commit 1a75466

@henryiii
Copy link

Choose a reason for hiding this comment

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

@catherinedevlin

This was a version-based IPython change, not related to browser (as browsers do not affect what is in the IPython namespace), I believe: https://stackoverflow.com/questions/28703626/ipython-change-input-cell-syntax-highlighting-logic-for-entire-session

options_default vs. config_defaults, based on IPython version.

Please sign in to comment.