Skip to content

Commit

Permalink
Escape quotes in description as appropriate (#57)
Browse files Browse the repository at this point in the history
  • Loading branch information
fcollonval committed Dec 13, 2023
1 parent e926714 commit 9fdfe52
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 2 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,50 @@ jobs:
popd
rm -rf ${NAME}
quoted-description:
runs-on: ubuntu-latest
strategy:
matrix:
# This will be used by the base setup action
python-version: ["3.11"]

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Base Setup
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1

- name: Install dependencies
run: |
python -m pip install "copier>=8.0.0" jinja2-time "pydantic<2.0.0"
- name: Setup Git
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
- name: Create pure frontend extension
run: |
set -eux
mkdir myextension
python -m copier copy -l -d author_name="My Name" -d description="Let's \"rock and roll\"" -d repository="https://github.com/test/lab-extension" --vcs-ref HEAD --UNSAFE . myextension
pushd myextension
pip install "jupyterlab>=4.0.0,<5"
YARN_ENABLE_IMMUTABLE_INSTALLS=false jlpm
jlpm lint:check
pip install -e .
jupyter labextension develop . --overwrite
jupyter labextension list
jupyter labextension list 2>&1 | grep -ie "myextension.*OK"
python -m jupyterlab.browser_check
jupyter labextension uninstall myextension
pip uninstall -y myextension jupyterlab
popd
rm -rf myextension
no-tests:
runs-on: ubuntu-latest
strategy:
Expand Down
2 changes: 1 addition & 1 deletion template/package.json.jinja
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "{{ labextension_name }}",
"version": "0.1.0",
"description": "{{ project_short_description }}",
"description": "{{ project_short_description | replace('"', '\\"') }}",
"keywords": [
"jupyter",
"jupyterlab",
Expand Down
2 changes: 1 addition & 1 deletion template/src/index.ts.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { requestAPI } from './handler';{% endif %}
*/
const plugin: JupyterFrontEndPlugin<void> = {
id: '{{ labextension_name }}:plugin',
description: '{{ project_short_description }}',
description: '{{ project_short_description | replace("'", "\\'") }}',
autoStart: true,{% if kind.lower() == 'theme' %}
requires: [IThemeManager],{% endif %}{% if has_settings %}
optional: [ISettingRegistry],{% endif %}
Expand Down

0 comments on commit 9fdfe52

Please sign in to comment.