Skip to content

Commit

Permalink
Adds rule 19 Google Drive image links (#26)
Browse files Browse the repository at this point in the history
* Adds rule 19 no code in headings

Adds issue covers standard RST syntax, MD syntax, MyST syntax, and raw HTML syntax
Adds testing for rule 19
Removes superfluous field from rule 09

* Update 019-no-google-drive-images.yml

---------

Co-authored-by: Nick Veitch <[email protected]>
  • Loading branch information
SecondSkoll and evilnick committed May 29, 2024
1 parent 9c5ee4f commit 20cc3e9
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 1 deletion.
1 change: 0 additions & 1 deletion styles/Canonical/009-Headings-no-links.yml
Original file line number Diff line number Diff line change
@@ -1,6 1,5 @@
# 09 - Heading - Headings should not contain links

name: 009
extends: existence
message: "Headings should not contain links"
link: https://docs.ubuntu.com/styleguide/en/#other-considerations
Expand Down
15 changes: 15 additions & 0 deletions styles/Canonical/019-no-google-drive-images.yml
Original file line number Diff line number Diff line change
@@ -0,0 1,15 @@
# 19 - No Google Drive links

extends: existence
message: "Don't use images from Google Drive."
scope: raw
nonword: true
level: warning
tokens:
- '!\[[^\n]*\]\([\w\.:\/\-=\? \"] (drive.google|drive.usercontent.google)[\w\.:\/\-=\? \"] \)'
- '<[\w\.:\/-=? "] (drive.google|drive.usercontent.google)[\w\.:\/\-=? "] >'
- '{image}[\w\.:\/\-=? "] (drive.google|drive.usercontent.google)[\w\.:\/\-=? "] '
- '{figure}[\w\.:\/\-=? "] (drive.google|drive.usercontent.google)[\w\.:\/\-=? "] '
- '.. image::[\w\.:\/\-=? "] (drive.google|drive.usercontent.google)[\w\.:\/\-=? "] '
- '.. figure::[\w\.:\/\-=? "] (drive.google|drive.usercontent.google)[\w\.:\/\-=? "] '

23 changes: 23 additions & 0 deletions test/test019.md
Original file line number Diff line number Diff line change
@@ -0,0 1,23 @@
# Some test

![This is some text](https://drive.usercontent.google.com/download?id=1l7YBeMeR9iCSGGR8gbiWXkf1zPzQg2lN)
![This is some text](https://drive.google.com/file/d/1l7YBeMeR9iCSGGR8gbiWXkf1zPzQg2lN)
![This is some text](https://www.test.com/etc_sboqo-asboucouqfe/)

<img src="https://drive.google.com/file/d/1l7YBeMeR9iCSGGR8gbiWXkf1zPzQg2lN" alt="fishy" width="200px" class="bg-primary">


```{image} https://drive.google.com/file/d/1l7YBeMeR9iCSGGR8gbiWXkf1zPzQg2lN
:alt: fishy
:class: bg-primary
:width: 200px
:align: center
```


```{figure} https://drive.usercontent.google.com/download?id=1l7YBeMeR9iCSGGR8gbiWXkf1zPzQg2lN
:alt: fishy
:class: bg-primary
:width: 200px
:align: center
```
16 changes: 16 additions & 0 deletions test/test019.rst
Original file line number Diff line number Diff line change
@@ -0,0 1,16 @@
Some text
=========

.. image:: https://drive.usercontent.google.com/download?id=1l7YBeMeR9iCSGGR8gbiWXkf1zPzQg2lN

:alt: fishy
:class: bg-primary
:width: 200px
:align: center

.. figure:: https://drive.google.com/file/d/1l7YBeMeR9iCSGGR8gbiWXkf1zPzQg2lN

:alt: fishy
:class: bg-primary
:width: 200px
:align: center

0 comments on commit 20cc3e9

Please sign in to comment.