prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  In the rich-text editor, auto-prepend "https://" to links which don't specify a protocol
  ```
  Currently the non-interactive link widget will only accept links that begin 
  with either "http://" or "https://". I propose that whenever a link does not, 
  e.g. "www.google.com" we automatically prepend "http://www.google.com" to the 
  link string that is stored.
  ```
  
  Original issue reported on code.google.com by `jacobdav...@gmail.com` on 24 Aug 2014 at 9:43
  
  
  </issue>
  <code>
  [start of extensions/rich_text_components/Link/Link.py]
  1 # coding: utf-8
  2 #
  3 # Copyright 2014 The Oppia Authors. All Rights Reserved.
  4 #
  5 # Licensed under the Apache License, Version 2.0 (the "License");
  6 # you may not use this file except in compliance with the License.
  7 # You may obtain a copy of the License at
  8 #
  9 #      http://www.apache.org/licenses/LICENSE-2.0
  10 #
  11 # Unless required by applicable law or agreed to in writing, softwar
  12 # distributed under the License is distributed on an "AS-IS" BASIS,
  13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14 # See the License for the specific language governing permissions and
  15 # limitations under the License.
  16 
  17 from extensions.rich_text_components import base
  18 
  19 
  20 class Link(base.BaseRichTextComponent):
  21     """A rich-text component for displaying links."""
  22 
  23     name = 'Link'
  24     category = 'Basic Input'
  25     description = 'A link to a URL.'
  26     frontend_name = 'link'
  27     tooltip = 'Insert link'
  28 
  29     _customization_arg_specs = [{
  30         'name': 'url',
  31         'description': (
  32             'The link URL. It must start with http:// or https://'),
  33         'schema': {
  34             'type': 'custom',
  35             'obj_type': 'SanitizedUrl',
  36         },
  37         'default_value': 'https://www.example.com',
  38     }, {
  39         'name': 'text',
  40         'description': (
  41             'The link text. If left blank, the link URL will be used.'),
  42         'schema': {
  43             'type': 'unicode',
  44         },
  45         'default_value': '',
  46     }, {
  47         'name': 'open_link_in_same_window',
  48         'description': 'Open the link in the same window?',
  49         'schema': {
  50             'type': 'bool'
  51         },
  52         'default_value': False,
  53     }]
  54
  [end of extensions/rich_text_components/Link/Link.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/extensions/rich_text_components/Link/Link.py b/extensions/rich_text_components/Link/Link.py
  --- a/extensions/rich_text_components/Link/Link.py
  +++ b/extensions/rich_text_components/Link/Link.py
  @@ -29,7 +29,7 @@
       _customization_arg_specs = [{
           'name': 'url',
           'description': (
  -            'The link URL. It must start with http:// or https://'),
  +            'The link URL. If no protocol is specified, HTTPS will be used.'),
           'schema': {
               'type': 'custom',
               'obj_type': 'SanitizedUrl',
  
verification_info: {"golden_diff": "diff --git a/extensions/rich_text_components/Link/Link.py b/extensions/rich_text_components/Link/Link.py\n--- a/extensions/rich_text_components/Link/Link.py\n+++ b/extensions/rich_text_components/Link/Link.py\n@@ -29,7 +29,7 @@\n     _customization_arg_specs = [{\n         'name': 'url',\n         'description': (\n-            'The link URL. It must start with http:// or https://'),\n+            'The link URL. If no protocol is specified, HTTPS will be used.'),\n         'schema': {\n             'type': 'custom',\n             'obj_type': 'SanitizedUrl',\n", "issue": "In the rich-text editor, auto-prepend \"https://\" to links which don't specify a protocol\n```\nCurrently the non-interactive link widget will only accept links that begin \nwith either \"http://\" or \"https://\". I propose that whenever a link does not, \ne.g. \"www.google.com\" we automatically prepend \"http://www.google.com\" to the \nlink string that is stored.\n```\n\nOriginal issue reported on code.google.com by `jacobdav...@gmail.com` on 24 Aug 2014 at 9:43\n\n", "before_files": [{"content": "# coding: utf-8\n#\n# Copyright 2014 The Oppia Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, softwar\n# distributed under the License is distributed on an \"AS-IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom extensions.rich_text_components import base\n\n\nclass Link(base.BaseRichTextComponent):\n    \"\"\"A rich-text component for displaying links.\"\"\"\n\n    name = 'Link'\n    category = 'Basic Input'\n    description = 'A link to a URL.'\n    frontend_name = 'link'\n    tooltip = 'Insert link'\n\n    _customization_arg_specs = [{\n        'name': 'url',\n        'description': (\n            'The link URL. It must start with http:// or https://'),\n        'schema': {\n            'type': 'custom',\n            'obj_type': 'SanitizedUrl',\n        },\n        'default_value': 'https://www.example.com',\n    }, {\n        'name': 'text',\n        'description': (\n            'The link text. If left blank, the link URL will be used.'),\n        'schema': {\n            'type': 'unicode',\n        },\n        'default_value': '',\n    }, {\n        'name': 'open_link_in_same_window',\n        'description': 'Open the link in the same window?',\n        'schema': {\n            'type': 'bool'\n        },\n        'default_value': False,\n    }]\n", "path": "extensions/rich_text_components/Link/Link.py"}]}