fix: skip interpolation for strings inside square brackets
fixes #554
**Describe the bug**
advancedFormat and buddhistEra plugins are changing/interpolating content inside square brackets

```javascript
// with advancedFormat
const dayJSformat = dayjs.format('[Saturday]') // outputs: outputs something like "1418400000aturday"
const momentFormat = moment.format('[Saturday]') // outputs: "Saturday"
expect(dayJSformat).toEqual(momentFormat) // throws
```
**Expected behavior**
any plugins extending the format method interpolation should uphold behavior of the original format method and not change/interpolate content inside square brackets

**Information**
 - Day.js Version: all
 - OS: all
 - Browser: all

avancedFormat plugin is interpolating content inside square brackets
diff --git a/src/plugin/advancedFormat/index.js b/src/plugin/advancedFormat/index.js
index 1b5288c08..117831b8d 100644
--- a/src/plugin/advancedFormat/index.js
+++ b/src/plugin/advancedFormat/index.js
@@ -13,7 +13,7 @@ export default (o, c, d) => { // locale needed later
     const locale = this.$locale()
     const utils = this.$utils()
     const str = formatStr || FORMAT_DEFAULT
-    const result = str.replace(/Q|wo|gggg|Do|X|x|k{1,2}|S/g, (match) => {
+    const result = str.replace(/\[([^\]]+)]|Q|wo|gggg|Do|X|x|k{1,2}|S/g, (match) => {
       switch (match) {
         case 'Q':
           return Math.ceil((this.$M + 1) / 3)
@@ -28,8 +28,10 @@ export default (o, c, d) => { // locale needed later
           return utils.s(String(this.$H === 0 ? 24 : this.$H), match === 'k' ? 1 : 2, '0')
         case 'X':
           return Math.floor(this.$d.getTime() / 1000)
-        default: // 'x'
+        case 'x':
           return this.$d.getTime()
+        default:
+          return match
       }
     })
     return oldFormat.bind(this)(result)
diff --git a/src/plugin/buddhistEra/index.js b/src/plugin/buddhistEra/index.js
index 3ee0dd520..ff0481433 100644
--- a/src/plugin/buddhistEra/index.js
+++ b/src/plugin/buddhistEra/index.js
@@ -7,10 +7,10 @@ export default (o, c) => { // locale needed later
   proto.format = function (formatStr) {
     const yearBias = 543
     const str = formatStr || FORMAT_DEFAULT
-    const result = str.replace(/BBBB|BB/g, (match) => {
+    const result = str.replace(/(\[[^\]]+])|BBBB|BB/g, (match, a) => {
       const year = String(this.$y + yearBias)
       const args = match === 'BB' ? [year.slice(-2), 2] : [year, 4]
-      return this.$utils().s(...args, '0')
+      return a || this.$utils().s(...args, '0')
     })
     return oldFormat.bind(this)(result)
   }

diff --git a/test/plugin/advancedFormat.test.js b/test/plugin/advancedFormat.test.js
index 74de4eb9b..e3ccaddcf 100644
--- a/test/plugin/advancedFormat.test.js
+++ b/test/plugin/advancedFormat.test.js
@@ -82,3 +82,14 @@ it('Format Week Year gggg', () => {
   const d = '2018-12-31'
   expect(dayjs(d).format('gggg')).toBe(moment(d).format('gggg'))
 })
+
+it('Skips format strings inside brackets', () => {
+  expect(dayjs().format('[Q]')).toBe('Q')
+  expect(dayjs().format('[Do]')).toBe('Do')
+  expect(dayjs().format('[gggg]')).toBe('gggg')
+  expect(dayjs().format('[wo]')).toBe('wo')
+  expect(dayjs().format('[k]')).toBe('k')
+  expect(dayjs().format('[kk]')).toBe('kk')
+  expect(dayjs().format('[X]')).toBe('X')
+  expect(dayjs().format('[x]')).toBe('x')
+})
diff --git a/test/plugin/buddhistEra.test.js b/test/plugin/buddhistEra.test.js
index 2482702f8..626df54ce 100644
--- a/test/plugin/buddhistEra.test.js
+++ b/test/plugin/buddhistEra.test.js
@@ -31,3 +31,8 @@ it('Format Buddhist Era 4 digit with other format', () => {
   const momentDate = today.format(format).replace('BBBB', today.year() + 543)
   expect(dayjs().format(format)).toBe(momentDate)
 })
+
+it('Skips format strings inside brackets', () => {
+  expect(dayjs().format('[BBBB]')).toBe('BBBB')
+  expect(dayjs().format('[BB]')).toBe('BB')
+})

{"test/plugin/advancedFormat.test.js": {"run": "PASS", "test": "FAIL", "fix": "PASS"}, "test/plugin/buddhistEra.test.js": {"run": "PASS", "test": "FAIL", "fix": "PASS"}}
{"test/timezone.test.js:Add Time days (DST)": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "test/plugin.test.js": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "test/get-set.test.js": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "test/plugin/utc.test.js": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "test/plugin/quarterOfYear.test.js": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "test/plugin/weekYear.test.js": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "test/plugin/toArray.test.js": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "test/timezone.test.js": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "test/timezone.test.js:Utc Offset": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "test/plugin/isSameOrBefore.test.js": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "test/timezone.test.js:Diff (DST)": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "test/locale/keys.test.js": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "test/utils.test.js": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "test/plugin/relativeTime.test.js": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "test/parse.test.js": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "test/plugin/isMoment.test.js": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "test/plugin/localizableFormat.test.js": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "test/plugin/toObject.test.js": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "test/constructor.test.js": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "test/plugin/isSameOrAfter.test.js": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "test/plugin/weekOfYear.test.js": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "test/plugin/isLeapYear.test.js": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "test/comparison.test.js": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "test/query.test.js": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "test/plugin/localeData.test.js": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "test/plugin/calendar.test.js": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "test/plugin/declarations.test.js": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "test/locale.test.js": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "test/plugin/badMutable.test.js": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "test/plugin/customParseFormat.test.js": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "test/plugin/dayOfYear.test.js": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "test/plugin/minMax.test.js": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "test/plugin/isoWeeksInYear.test.js": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "test/manipulate.test.js": {"run": "PASS", "test": "PASS", "fix": "PASS"}, "test/plugin/isBetween.test.js": {"run": "PASS", "test": "PASS", "fix": "PASS"}}
{"test/plugin/advancedFormat.test.js": {"run": "PASS", "test": "FAIL", "fix": "PASS"}, "test/plugin/buddhistEra.test.js": {"run": "PASS", "test": "FAIL", "fix": "PASS"}}
{"passed_count": 37, "failed_count": 1, "skipped_count": 0, "passed_tests": ["test/timezone.test.js:Add Time days (DST)", "test/plugin.test.js", "test/get-set.test.js", "test/plugin/utc.test.js", "test/plugin/quarterOfYear.test.js", "test/plugin/advancedFormat.test.js", "test/plugin/weekYear.test.js", "test/plugin/toArray.test.js", "test/timezone.test.js", "test/timezone.test.js:Utc Offset", "test/plugin/isSameOrBefore.test.js", "test/timezone.test.js:Diff (DST)", "test/locale/keys.test.js", "test/utils.test.js", "test/plugin/relativeTime.test.js", "test/parse.test.js", "test/plugin/isMoment.test.js", "test/plugin/localizableFormat.test.js", "test/plugin/toObject.test.js", "test/constructor.test.js", "test/plugin/isSameOrAfter.test.js", "test/plugin/weekOfYear.test.js", "test/plugin/isLeapYear.test.js", "test/comparison.test.js", "test/query.test.js", "test/plugin/localeData.test.js", "test/plugin/calendar.test.js", "test/plugin/declarations.test.js", "test/locale.test.js", "test/plugin/badMutable.test.js", "test/plugin/customParseFormat.test.js", "test/plugin/dayOfYear.test.js", "test/plugin/minMax.test.js", "test/plugin/isoWeeksInYear.test.js", "test/plugin/buddhistEra.test.js", "test/manipulate.test.js", "test/plugin/isBetween.test.js"], "failed_tests": ["test/display.test.js"], "skipped_tests": []}
{"passed_count": 35, "failed_count": 3, "skipped_count": 0, "passed_tests": ["test/timezone.test.js:Add Time days (DST)", "test/get-set.test.js", "test/plugin.test.js", "test/plugin/utc.test.js", "test/plugin/quarterOfYear.test.js", "test/plugin/weekYear.test.js", "test/plugin/toArray.test.js", "test/timezone.test.js", "test/plugin/isSameOrBefore.test.js", "test/timezone.test.js:Utc Offset", "test/timezone.test.js:Diff (DST)", "test/locale/keys.test.js", "test/utils.test.js", "test/plugin/relativeTime.test.js", "test/parse.test.js", "test/plugin/isMoment.test.js", "test/plugin/localizableFormat.test.js", "test/plugin/toObject.test.js", "test/constructor.test.js", "test/plugin/isSameOrAfter.test.js", "test/plugin/weekOfYear.test.js", "test/plugin/isLeapYear.test.js", "test/comparison.test.js", "test/query.test.js", "test/plugin/localeData.test.js", "test/plugin/calendar.test.js", "test/plugin/declarations.test.js", "test/plugin/badMutable.test.js", "test/locale.test.js", "test/plugin/customParseFormat.test.js", "test/plugin/dayOfYear.test.js", "test/plugin/minMax.test.js", "test/plugin/isoWeeksInYear.test.js", "test/manipulate.test.js", "test/plugin/isBetween.test.js"], "failed_tests": ["test/plugin/advancedFormat.test.js", "test/plugin/buddhistEra.test.js", "test/display.test.js"], "skipped_tests": []}
{"passed_count": 37, "failed_count": 1, "skipped_count": 0, "passed_tests": ["test/timezone.test.js:Add Time days (DST)", "test/get-set.test.js", "test/plugin.test.js", "test/plugin/utc.test.js", "test/plugin/quarterOfYear.test.js", "test/plugin/advancedFormat.test.js", "test/plugin/weekYear.test.js", "test/plugin/toArray.test.js", "test/timezone.test.js", "test/timezone.test.js:Utc Offset", "test/plugin/isSameOrBefore.test.js", "test/timezone.test.js:Diff (DST)", "test/locale/keys.test.js", "test/utils.test.js", "test/plugin/relativeTime.test.js", "test/parse.test.js", "test/plugin/localizableFormat.test.js", "test/plugin/isMoment.test.js", "test/plugin/toObject.test.js", "test/constructor.test.js", "test/plugin/isSameOrAfter.test.js", "test/plugin/weekOfYear.test.js", "test/plugin/isLeapYear.test.js", "test/comparison.test.js", "test/query.test.js", "test/plugin/localeData.test.js", "test/plugin/calendar.test.js", "test/plugin/declarations.test.js", "test/locale.test.js", "test/plugin/badMutable.test.js", "test/plugin/customParseFormat.test.js", "test/plugin/minMax.test.js", "test/plugin/dayOfYear.test.js", "test/plugin/isoWeeksInYear.test.js", "test/manipulate.test.js", "test/plugin/buddhistEra.test.js", "test/plugin/isBetween.test.js"], "failed_tests": ["test/display.test.js"], "skipped_tests": []}